-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (31 loc) · 986 Bytes
/
cd.yml
File metadata and controls
39 lines (31 loc) · 986 Bytes
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
name: CD Pipeline
on:
push:
branches:
- main
workflow_dispatch: {}
env:
VERSION: v1.${{ github.run_number }}
jobs:
release-main:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker (prod)
run: docker build -t nifipulse-prod .
- name: Create and push git tag
run: |
echo "Tagging version: $VERSION"
git tag "$VERSION"
git push origin "$VERSION"
- name: Log in to Docker Hub
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" \
| docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push Docker image
run: |
docker tag nifipulse-prod myregistry/nifipulse:${{ env.VERSION }}
docker push myregistry/nifipulse:${{ env.VERSION }}
docker tag nifipulse-prod myregistry/nifipulse:latest
docker push myregistry/nifipulse:latest