docker-proxy-acl CI #116
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: docker-proxy-acl CI | |
on: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 12 * * 1' | |
push: | |
branches: [ master, beta ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build-docker-proxy-acl: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Build Repo | |
uses: actions/checkout@v2 | |
with: | |
path: ./build | |
- name: Checkout App Repo | |
uses: actions/checkout@v2 | |
with: | |
repository: dcflachs/docker-proxy-acl | |
path: ./app | |
- name: Get Git SHA | |
id: sha | |
shell: bash | |
working-directory: ./app | |
run: | | |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT | |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Docker Repo | |
id: repo | |
run: echo "repo=dcflachs/docker-proxy-acl" >> $GITHUB_OUTPUT | |
- name: Set Main Tag | |
id: main_tag | |
shell: bash | |
run: | | |
if [[ "${{ steps.sha.outputs.branch }}" == "master" ]] | |
then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=beta" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./build/docker-proxy-acl | |
platforms: linux/amd64,linux/arm/v6,linux/arm/v7 | |
push: true | |
labels: | | |
`org.opencontainers.image.revision=${{ steps.sha.outputs.sha_short }}` | |
tags: | | |
${{ steps.repo.outputs.repo }}:${{ steps.main_tag.outputs.tag }} | |
${{ steps.repo.outputs.repo }}:nightly-${{ steps.date.outputs.date }} | |
${{ steps.repo.outputs.repo }}:sha-${{ steps.sha.outputs.sha_short }} | |