From 94cf2108cdc371ff6ffb9002677eb7f5dfc0feb6 Mon Sep 17 00:00:00 2001 From: NSMBot Date: Tue, 1 Jun 2021 20:24:55 +0000 Subject: [PATCH] Sync files with networkservicemesh/cmd-template This PR syncs files with https://github.com/networkservicemesh/cmd-template Revision: https://github.com/networkservicemesh/cmd-template/commits/a56f245c851bc34228aa6e6c907e8ebd0032e065 commit a56f245c851bc34228aa6e6c907e8ebd0032e065 Author: Ed Warnicke Date: Tue Jun 1 15:23:50 2021 -0500 Add support for pushing to ghcr repos (#72) Signed-off-by: NSMBot --- .github/workflows/docker-push-ghcr.yml | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/docker-push-ghcr.yml diff --git a/.github/workflows/docker-push-ghcr.yml b/.github/workflows/docker-push-ghcr.yml new file mode 100644 index 0000000..2c2a1d0 --- /dev/null +++ b/.github/workflows/docker-push-ghcr.yml @@ -0,0 +1,40 @@ +--- +name: docker-push-ghcr + +on: + push: + branches: [main] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - 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: Docker meta + id: metaci + uses: docker/metadata-action@v3 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/ci + tags: | + type=ref,event=pr + type=sha,prefix= + + - name: "Build and push" + uses: docker/build-push-action@v2 + with: + file: Dockerfile + context: . + push: true + tags: ${{ steps.metaci.outputs.tags }}