From 206ae5865a00c90371af8cdd72b36ddd51e5f984 Mon Sep 17 00:00:00 2001 From: Oscar Eriksson Date: Tue, 5 Mar 2024 11:57:29 +0100 Subject: [PATCH] Add ghcr build --- .github/workflows/build.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..bcf7098c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build and push Docker image + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Build docker container + + runs-on: ubuntu-latest + + permissions: + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + if: ${{ github.ref == 'refs/heads/master' }} + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build Docker image (and push on master) + uses: docker/build-push-action@v4.0.0 + with: + push: ${{ github.ref == 'refs/heads/master' }} + tags: ghcr.io/cthit/findit:latest