Skip to content

Commit

Permalink
Try not using buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
andychase committed Oct 23, 2024
1 parent 71efe06 commit b3f449a
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
##
name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch 'main' or a tag is pushed.
on:
push:
branches:
Expand Down Expand Up @@ -30,18 +28,14 @@ jobs:
run: echo "IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build and push the Docker image with two tags: one using the Git tag or SHA, and another using 'main'.
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }}
ghcr.io/${{ env.IMAGE_NAME }}:main
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

# Build the Docker image
- name: Build Docker image
run: docker build -t ghcr.io/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }} -t ghcr.io/${{ env.IMAGE_NAME }}:main .

# Push the Docker image to the registry
- name: Push Docker image
run: |
docker push ghcr.io/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }}
docker push ghcr.io/${{ env.IMAGE_NAME }}:main

0 comments on commit b3f449a

Please sign in to comment.