-
Notifications
You must be signed in to change notification settings - Fork 147
42 lines (34 loc) · 1.14 KB
/
deploy.prod.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
name: Deploy to production
on:
create:
tags:
- collect-*
jobs:
push_to_docker_hub:
if: ${{ startsWith(github.ref, 'refs/tags/collect-') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all tags, default 1
- name: Get the version
id: app_version
run: echo ::set-output name=APP_VERSION::$(git describe --always --tags)
- run: echo ${{ steps.app_version.outputs.APP_VERSION }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image and push to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/collect:latest
${{ secrets.DOCKER_HUB_USERNAME }}/collect:${{ steps.app_version.outputs.APP_VERSION }}