-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 910 Bytes
/
ci.yaml
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
name: Build and publish app
on:
workflow_dispatch:
push:
env:
REGISTRY: severalnines
IMAGE: ${{ github.event.repository.name }}
jobs:
build-publish:
name: Build, Publish
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.REGISTRY }}
password: ${{ secrets.DH_PASS }}
- name: Build docker image
run: |-
docker build \
--tag "$REGISTRY/$IMAGE:build-$GITHUB_RUN_NUMBER" \
--tag "$REGISTRY/$IMAGE:latest" \
-f Dockerfile \
.
- name: Publish docker image
run: |-
docker push "$REGISTRY/$IMAGE:build-$GITHUB_RUN_NUMBER"
docker push "$REGISTRY/$IMAGE:latest"
if: github.ref_name == 'main'