Add condition to remove temp email file based on REMOVE_TEMP_EMAIL va… #92
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 & Push CaddyOctane | |
on: | |
push: | |
branches: | |
- 'main' | |
env: | |
ORG_NAME: lostlink | |
APP_NAME: caddy-octane | |
jobs: | |
should_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Detect File Changes | |
uses: trilom/[email protected] | |
- name: Changed Files List | |
run: | | |
jq -r '.[]' $HOME/files.json | |
- name: Filter and set Build Status | |
id: build | |
run: | | |
unique_entries=$(jq -r '.[] | select(test("caddy-octane"))' $HOME/files.json | awk -v RS=' ' '!a[$1]++') | |
if [[ ! -z "$unique_entries" ]] | |
then | |
status="deploy" | |
else | |
status="skip" | |
fi | |
echo "status=$status" >> $GITHUB_OUTPUT | |
outputs: | |
status: ${{ steps.build.outputs.status }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: should_deploy | |
if: needs.should_deploy.outputs.status == 'deploy' | |
strategy: | |
fail-fast: false | |
matrix: | |
build: | |
- {tag: "8.0-cli-buster", caddy-tag: "latest", caddy-builder-tag: "builder", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.0.26-cli-buster", caddy-tag: "latest", caddy-builder-tag: "builder", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.1-cli-buster", caddy-tag: "latest", caddy-builder-tag: "builder", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.1.13-cli-buster", caddy-tag: "latest", caddy-builder-tag: "builder", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.2-cli-buster", caddy-tag: "latest", caddy-builder-tag: "builder", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "latest", caddy-tag: "latest", caddy-builder-tag: "builder", platforms: "linux/arm64,linux/amd64"} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Import environment variables from a file | |
uses: cardinalby/export-env-action@v2 | |
with: | |
envFile: "docker.env" | |
expand: "true" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:${{ env.APP_NAME }}" | |
platforms: ${{ matrix.build.platforms }} | |
push: true | |
tags: ${{ env.ORG_NAME }}/${{ env.APP_NAME }}:${{ matrix.build.tag }} | |
build-args: | | |
"OCTANE_TAG=${{ matrix.build.tag }}" | |
"CADDY_TAG=${{ matrix.build.caddy-tag }}" | |
"CADDY_BUILDER_TAG=${{ matrix.build.caddy-builder-tag }}" | |
"CADDY_ORIGIN_URL=${{ env.CADDY_ORIGIN_URL }}" |