Skip to content

Commit

Permalink
use docker Build & Push action
Browse files Browse the repository at this point in the history
  • Loading branch information
celloman committed Jul 12, 2021
1 parent 8f29c10 commit f1f82e9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
44 changes: 21 additions & 23 deletions .github/workflows/release-build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/p8e-ui
DOCKER_TAGS=$IMAGE_ID:$VERSION
PRERELEASE=${{ github.event.release.prerelease }}
echo PRERELEASE=$PRERELEASE
if [ "$PRERELEASE" == "false" ]; then
DOCKER_TAGS=$DOCKER_TAGS,$IMAGE_ID:latest
fi
echo "DOCKER_TAGS=$DOCKER_TAGS" >> $GITHUB_ENV
- name: Download Artifact
uses: actions/download-artifact@v2
with:
Expand All @@ -101,33 +114,18 @@ jobs:
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}

- name: Build image
run: docker build . --file docker/Dockerfile --tag "p8e-ui:$VERSION" --load

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/p8e-ui
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag "p8e-ui:$VERSION" $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
PRERELEASE=${{ github.event.release.prerelease }}
echo PRERELEASE=$PRERELEASE
if [ "$PRERELEASE" == "false" ]; then
docker tag "p8e-ui:$VERSION" $IMAGE_ID:latest
docker push $IMAGE_ID:latest
fi
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.DOCKER_TAGS }}

0 comments on commit f1f82e9

Please sign in to comment.