-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (25 loc) · 1014 Bytes
/
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
name: Build & Push to Dockerhub
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Dockerhub
run: echo ${{secrets.DOCKERHUB_ACCESS_TOKEN}} | docker login -u ${{vars.DOCKERHUB_USERNAME}} --password-stdin
- name: Build intermediate Docker image
run: docker build -f deployment/docker/Dockerfile -t formio/pdf-libs:tmp .
- name: Run tests on the Docker image
run: docker run formio/pdf-libs:tmp npm test
- name: Build the Docker image
run: docker build -f deployment/docker/Dockerfile-no-tests -t formio/pdf-libs:${{github.ref_name}} .
- name: Push the Docker image
run: docker push formio/pdf-libs:${{github.ref_name}}
- name: Push latest
run: |
docker tag formio/pdf-libs:${{github.ref_name}} formio/pdf-libs:latest
docker push formio/pdf-libs:latest
if: ${{ !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'test') }}