-
Notifications
You must be signed in to change notification settings - Fork 24
48 lines (41 loc) · 1.32 KB
/
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
name: docker-push-dockerhub
on:
push:
branches: ["master"]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to docker.io
uses: docker/[email protected]
with:
registry: docker.io
username: ${{ secrets.DOCKER_NAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date -u '+%F-%T')"
- name: Get short SHA
id: sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.alpine
push: true
build-args: |
COMMITHASH=${{ steps.sha.outputs.sha }}
BUILDTIME=${{ steps.date.outputs.date }}
tags: docker.io/${{ secrets.DOCKER_NAME }}/moksha-mint:latest, docker.io/${{ secrets.DOCKER_NAME }}/moksha-mint:${{ steps.sha.outputs.sha }}
deploy:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: DigitalOcean App Platform deployment
uses: digitalocean/[email protected]
with:
app_name: moksha-mint
token: ${{ secrets.DO_TOKEN }}