Bump whoan/docker-build-with-cache-action from 8.0.0 to 8.0.2 #1681
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: Publish | |
on: | |
push: | |
branches: [main] | |
tags: ["*"] | |
pull_request: | |
branches: [main] | |
pull_request_target: | |
branches: [main] | |
jobs: | |
variables: | |
runs-on: ubuntu-latest | |
outputs: | |
ref: ${{ steps.variables.outputs.ref }} | |
sha: ${{ steps.variables.outputs.sha }} | |
sha8: ${{ steps.variables.outputs.sha8 }} | |
date: ${{ steps.variables.outputs.date }} | |
version: ${{ steps.variables.outputs.version }} | |
docker_image_name: ${{ steps.variables.outputs.docker_image_name }} | |
docker_image_tag: ${{ steps.variables.outputs.docker_image_tag }} | |
docker_image_fqn: ${{ steps.variables.outputs.docker_image_fqn }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: "5.x.x" | |
- id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Generate variables | |
id: variables | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: ./.github/scripts/variables.sh ${{ steps.gitversion.outputs.fullSemVer }} | |
docker-publish: | |
runs-on: ubuntu-latest | |
needs: variables | |
if: | | |
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || | |
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name != 'pull_request_target' }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'pull_request_target' }} | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Publish unstable Docker image to GitHub Package Registry | |
if: startsWith(github.ref, 'refs/tags/') != true | |
uses: whoan/[email protected] | |
with: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: docker.pkg.github.com | |
image_name: jekyll-plantuml | |
image_tag: ${{ needs.variables.outputs.docker_image_tag }} | |
dockerfile: .docker/Dockerfile | |
push_image_and_stages: ./.github/scripts/docker_run_test.sh build --image ${{ needs.variables.outputs.docker_image_fqn }} --image-tag ${{ needs.variables.outputs.docker_image_tag }} --repository ${{ github.repository }} --dir ${{ github.workspace }}/tests/minimal --token ${{ secrets.GITHUB_TOKEN }} --verbose --no-pull | |
pull_image_and_stages: false | |
build_extra_args: --build-arg TAG="${{ needs.variables.outputs.docker_image_tag }}" --build-arg SHA="${{ needs.variables.outputs.sha }}" --build-arg DATE="${{ needs.variables.outputs.date }}" --build-arg VERSION="${{ needs.variables.outputs.version }}" | |
- name: Publish stable Docker image to Docker Hub | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: whoan/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: "${{ secrets.DOCKERHUB_PASSWORD }}" | |
image_name: swedbankpay/jekyll-plantuml | |
image_tag: ${{ needs.variables.outputs.docker_image_tag }} | |
dockerfile: .docker/Dockerfile | |
push_image_and_stages: ./.github/scripts/docker_run_test.sh build --image ${{ needs.variables.outputs.docker_image_fqn }} --image-tag ${{ needs.variables.outputs.docker_image_tag }} --repository ${{ github.repository }} --dir ${{ github.workspace }}/tests/minimal --token ${{ secrets.GITHUB_TOKEN }} --verbose --no-pull | |
pull_image_and_stages: false | |
build_extra_args: --build-arg TAG="${{ needs.variables.outputs.docker_image_tag }}" --build-arg SHA="${{ needs.variables.outputs.sha }}" --build-arg DATE="${{ needs.variables.outputs.date }}" --build-arg VERSION="${{ needs.variables.outputs.version }}" | |
docker-verify: | |
runs-on: ubuntu-latest | |
needs: [docker-publish, variables] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download and Run Image | |
run: | | |
./.github/scripts/docker_run_test.sh build \ | |
--image ${{ needs.variables.outputs.docker_image_fqn }} \ | |
--repository ${{ github.repository }} \ | |
--dir ${{ github.workspace }}/tests/minimal \ | |
--token ${{ secrets.GITHUB_TOKEN }} \ | |
--image-tag ${{ needs.variables.outputs.docker_image_tag }} \ | |
--verbose | |
- name: Deploy to GitHub Pages | |
run: | | |
./.github/scripts/deploy.sh \ | |
--repository ${{ github.repository }} \ | |
--ref ${{ github.ref }} \ | |
--token ${{ secrets.GITHUB_TOKEN }} \ | |
--image ${{ needs.variables.outputs.docker_image_fqn }} \ | |
--verbose |