From 206ae5865a00c90371af8cdd72b36ddd51e5f984 Mon Sep 17 00:00:00 2001 From: Oscar Eriksson Date: Tue, 5 Mar 2024 11:57:29 +0100 Subject: [PATCH 1/2] 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 From 8dadd476d1a240b5eb35809e9eb6ce57e159a0ca Mon Sep 17 00:00:00 2001 From: Oscar Eriksson Date: Tue, 5 Mar 2024 12:02:10 +0100 Subject: [PATCH 2/2] Use correct context --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcf7098c..02bafd33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,4 +30,5 @@ jobs: uses: docker/build-push-action@v4.0.0 with: push: ${{ github.ref == 'refs/heads/master' }} + context: ./frontend tags: ghcr.io/cthit/findit:latest