-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 2.25 KB
/
publish-to-dockerhub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Publish to Dockerhub
on:
release:
types: [published]
jobs:
publish:
name: Build and Publish docker image to dockerhub
permissions:
contents: write
pull-requests: write
packages: read
runs-on: ubuntu-latest
steps:
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Get version in manifest.json
id: manifest-version
uses: notiz-dev/github-action-json-property@release
with:
path: "public/manifest.json"
prop_path: "version"
- name: Ensure the manifest version matches the tag version
if: ${{ steps.manifest-version.outputs.prop != github.event.release.tag_name }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('The version in the manifest must match the tag.')
- name: Get version in package.json
id: package-version
uses: notiz-dev/github-action-json-property@release
with:
path: "package.json"
prop_path: "version"
- name: Ensure the package.json version matches the tag version
if: ${{ steps.package-version.outputs.prop != github.event.release.tag_name }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('The version in the package.json must match the tag.')
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and publish Docker image
run: |
docker buildx build --platform linux/amd64,linux/arm64/v8 -t daithihearn/cards-110-frontend:latest -t daithihearn/cards-110-frontend:${{ github.event.release.tag_name }} --push .