From 6945de55af89adc958682ee5f6add7eede8a2b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Del=20Rinc=C3=B3n=20L=C3=B3pez?= Date: Wed, 27 Sep 2023 13:17:35 +0200 Subject: [PATCH] Add Github workflow. --- .github/workflows/ci.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..ed8d29e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,23 @@ +name: Build and publish Docker image + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file BlazorApp1/Server/Dockerfile --tag ghcr.io/${{ github.actor }}/weatherforecastapp:${{ github.sha }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push the Docker image + run: docker push ghcr.io/${{ github.actor }}/weatherforecastapp:${{ github.sha }}