From 67283a4f7300e1a9b989f2938e5230ae4a7ef319 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Thu, 25 Aug 2022 12:18:33 +0100 Subject: [PATCH 1/2] feat: add Github Actions worflow to publish docker image --- .github/workflows/container.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/container.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..96c7acc --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,25 @@ +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v1 + - name: Login to docker registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build container image + run: docker buildx build -t ghcr.io/${github.repository}:latest -t ghcr.io/${github.repository}:${GITHUB_SHA} . + - name: Push image (latest) + run: docker push ghcr.io/${github.repository}:latest + - name: Push image + run: docker push ghcr.io/${github.repository}:${GITHUB_SHA} + From 9b7ca2c72c6b3a0dd7921ff664bbb4ec86018f12 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Thu, 15 Sep 2022 13:11:36 +0100 Subject: [PATCH 2/2] fix(ci): use correct substition syntax --- .github/workflows/container.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 96c7acc..a888c2c 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -17,9 +17,9 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build container image - run: docker buildx build -t ghcr.io/${github.repository}:latest -t ghcr.io/${github.repository}:${GITHUB_SHA} . + run: docker buildx build -t ghcr.io/${{ github.repository }}:latest -t ghcr.io/${{ github.repository }}:${GITHUB_SHA} . - name: Push image (latest) - run: docker push ghcr.io/${github.repository}:latest + run: docker push ghcr.io/${{ github.repository }}:latest - name: Push image - run: docker push ghcr.io/${github.repository}:${GITHUB_SHA} + run: docker push ghcr.io/${{ github.repository }}:${GITHUB_SHA}