Update Publish Docker workflow
This commit is contained in:
22
.github/workflows/publish-docker.yml
vendored
22
.github/workflows/publish-docker.yml
vendored
@@ -7,6 +7,9 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prepare
|
id: prepare
|
||||||
run: |
|
run: |
|
||||||
@@ -29,16 +32,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: crazy-max/ghaction-docker-buildx@v1
|
uses: crazy-max/ghaction-docker-buildx@v3
|
||||||
with:
|
with:
|
||||||
version: latest
|
buildx-version: latest
|
||||||
|
|
||||||
- name: Checkout Code
|
- name: Cache Docker Layers
|
||||||
uses: actions/checkout@v2.1.0
|
id: cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Docker Buildx (no push)
|
- name: Docker Buildx (no push)
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
--platform ${{ steps.prepare.outputs.docker_platforms }} \
|
--platform ${{ steps.prepare.outputs.docker_platforms }} \
|
||||||
--output "type=image,push=false" \
|
--output "type=image,push=false" \
|
||||||
--build-arg "TAG=${{ steps.prepare.outputs.tag }}" \
|
--build-arg "TAG=${{ steps.prepare.outputs.tag }}" \
|
||||||
@@ -59,6 +70,7 @@ jobs:
|
|||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
--platform ${{ steps.prepare.outputs.docker_platforms }} \
|
--platform ${{ steps.prepare.outputs.docker_platforms }} \
|
||||||
--output "type=image,push=true" \
|
--output "type=image,push=true" \
|
||||||
--build-arg "TAG=${{ steps.prepare.outputs.tag }}" \
|
--build-arg "TAG=${{ steps.prepare.outputs.tag }}" \
|
||||||
@@ -79,5 +91,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
status: ${{ job.status }}
|
status: ${{ job.status }}
|
||||||
job: ${{ github.workflow }}
|
title: ${{ github.workflow }}
|
||||||
nofail: true
|
nofail: true
|
||||||
|
Reference in New Issue
Block a user