mirror of
https://github.com/Neur0toxine/docker-node-alpine-git-gyp.git
synced 2024-12-01 08:36:03 +03:00
build: corrects migration to Docker's GH actions (#122)
This commit is contained in:
parent
9a2e2659cd
commit
2c7c16d29c
59
.github/workflows/buildx.yml
vendored
59
.github/workflows/buildx.yml
vendored
@ -2,7 +2,7 @@ name: buildx
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '37 06 * * *'
|
- cron: "37 06 * * *"
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
|
|
||||||
@ -12,12 +12,12 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
docker-file:
|
docker-file:
|
||||||
- path: 10
|
- path: 10
|
||||||
tags: 10,dubnium
|
tags: 10,dubnium
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
|
||||||
- path: 12
|
- path: 12
|
||||||
tags: 12,erbium,latest
|
tags: 12,erbium,latest
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -32,40 +32,53 @@ jobs:
|
|||||||
|
|
||||||
for tag in $TAGZ
|
for tag in $TAGZ
|
||||||
do
|
do
|
||||||
TAGS="${TAGS} --tag ${DOCKER_IMAGE}:${tag}"
|
TAGS="${TAGS},${DOCKER_IMAGE}:${tag}"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
echo ::set-output name=version::${VERSION}
|
echo ::set-output name=version::${VERSION}
|
||||||
echo ::set-output name=buildx_args::--platform ${{ matrix.docker-file.platforms }} \
|
echo ::set-output name=tags::${TAGS}
|
||||||
--build-arg REFRESHED_AT=$(date +%Y-%m-%d) \
|
|
||||||
${TAGS} --file ./${{ matrix.docker-file.path }}/Dockerfile ./${{ matrix.docker-file.path }}
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
with:
|
with:
|
||||||
version: latest
|
install: true
|
||||||
|
|
||||||
- name: Available platforms
|
- name: Available platforms
|
||||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
- name: Docker Buildx (build)
|
- name: Docker Buildx (build)
|
||||||
run: |
|
uses: docker/build-push-action@v2
|
||||||
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
|
if: success() && !contains(github.ref, 'master')
|
||||||
|
with:
|
||||||
|
push: false
|
||||||
|
context: ./${{ matrix.docker-file.path }}
|
||||||
|
file: ./${{ matrix.docker-file.path }}/Dockerfile
|
||||||
|
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
|
||||||
|
platforms: ${{ matrix.docker-file.platforms }}
|
||||||
|
tags: ${{ steps.prepare.outputs.tags }}
|
||||||
|
|
||||||
- name: Docker Login
|
- name: Docker Login
|
||||||
if: success() && github.event_name != 'pull_request'
|
if: success() && contains(github.ref, 'master')
|
||||||
env:
|
uses: docker/login-action@v1
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
with:
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
run: |
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
|
|
||||||
|
|
||||||
- name: Docker Buildx (push)
|
- name: Docker Buildx (push)
|
||||||
if: success() && github.event_name != 'pull_request'
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
if: success() && contains(github.ref, 'master')
|
||||||
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
|
with:
|
||||||
|
push: true
|
||||||
|
context: ./${{ matrix.docker-file.path }}
|
||||||
|
file: ./${{ matrix.docker-file.path }}/Dockerfile
|
||||||
|
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
|
||||||
|
platforms: ${{ matrix.docker-file.platforms }}
|
||||||
|
tags: ${{ steps.prepare.outputs.tags }}
|
||||||
|
|
||||||
- name: Docker Check Manifest
|
- name: Docker Check Manifest
|
||||||
if: always() && github.event_name != 'pull_request'
|
if: always() && github.event_name != 'pull_request'
|
||||||
|
Loading…
Reference in New Issue
Block a user