Build Docker Image #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker Image | |
on: | |
push: | |
paths: | |
- build.sh | |
- .github/workflows/build.yml | |
schedule: | |
- cron: '5 3 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login into Github Docker Registery | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Login into Docker Hub | |
run: echo "${{ secrets.DOCKER_HUB_PAT }}" | docker login -u shyim --password-stdin | |
- name: Get latest Adminerevo version | |
id: ADMINEREVO_VERSION | |
run: | | |
VERSION=$(curl https://api.github.com/repos/adminerevo/adminerevo/releases/latest | jq '.tag_name | ltrimstr("v")' -r) | |
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: | | |
ghcr.io/shyim/adminerevo:latest | |
ghcr.io/shyim/adminerevo:${{ steps.ADMINEREVO_VERSION.outputs.VERSION }} | |
shyim/adminerevo:latest | |
shyim/adminerevo:${{ steps.ADMINEREVO_VERSION.outputs.VERSION }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
ADMINEREVO_VERSION=${{ steps.ADMINEREVO_VERSION.outputs.VERSION }} |