Skip to content

Commit

Permalink
Create ghcr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Apr 26, 2021
1 parent 4bd14d2 commit fc383bc
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Push to GHCR

on:
push:
tags:
- '*'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v4
with:
strip_tag_prefix: 'v'

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.branch-name.outputs.tag }}

0 comments on commit fc383bc

Please sign in to comment.