CI: use Dockerfile.release for Docker images

This commit is contained in:
Jesse Chan
2021-01-13 11:56:11 +08:00
parent fb3cdb52e7
commit 0f5ce04ded
2 changed files with 25 additions and 6 deletions
+14 -5
View File
@@ -40,6 +40,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
docker:
needs: npm
runs-on: ubuntu-20.04
steps:
@@ -59,17 +60,25 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Tag rolling release
- name: Parse version
id: parse_version
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
npm version --no-git-tag-version 0.0.0-master.`git rev-parse --short HEAD`
echo ::set-output name=BUILD_VERSION::0.0.0-master.`git rev-parse --short HEAD`
- name: Wait until the package is available
uses: nick-invision/retry@v2
with:
command: curl -f -s https://registry.npmjs.org/@jesec/flood/${{ steps.parse_version.outputs.BUILD_VERSION }} &>/dev/null
timeout_minutes: 30
max_attempts: 15
retry_wait_seconds: 15
- name: Publish flood to Docker Hub
uses: docker/build-push-action@v2
with:
build-args: PACKAGE=@jesec/flood VERSION=${{ steps.parse_version.outputs.BUILD_VERSION }}
context: .
file: ./Dockerfile
file: ./Dockerfile.release
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: jesec/flood:master
+11 -1
View File
@@ -50,6 +50,7 @@ jobs:
dist-pkg/flood-win.exe
release-docker:
needs: release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
@@ -77,11 +78,20 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Wait until the package is available
uses: nick-invision/retry@v2
with:
command: curl -f -s https://registry.npmjs.org/flood/${{ steps.parse_semver.outputs.FULL_VERSION }} &>/dev/null
timeout_minutes: 30
max_attempts: 15
retry_wait_seconds: 15
- name: Publish to Docker Hub
uses: docker/build-push-action@v2
with:
build-args: VERSION=${{ steps.parse_semver.outputs.FULL_VERSION }}
context: .
file: ./Dockerfile
file: ./Dockerfile.release
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |