From dbd58c10e250f599b05cab1ed4c894ebe29f2fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sun, 18 Dec 2022 00:11:45 +0100 Subject: [PATCH] Build Docker images with GitHub actions --- .github/workflows/build.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 010cc4d..cf42a63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,4 +20,25 @@ jobs: - run: poetry install - run: poetry run pytest env: - TEST_WEBHOOK_URL: ${{ secrets.TEST_WEBHOOK_URL }} \ No newline at end of file + TEST_WEBHOOK_URL: ${{ secrets.TEST_WEBHOOK_URL }} + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/thelovinator1/discord-rss-bot + flavor: latest=${{ github.ref == 'refs/heads/master' }} + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v3 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file