-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.5 KB
/
build-push-stunnel.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Build and Push Stunnel to Dockerhub
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 0 * * SUN'
jobs:
build-push-stunnel:
runs-on: stunnel
env:
DOCKERHUB_REPO: bonztm/stunnel
steps:
- name: checkout repo content
uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "date=$(date --rfc-3339=date)" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create docker context
run: |
docker context create stunnel
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: stunnel
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.DOCKERHUB_REPO }}:latest,${{ env.DOCKERHUB_REPO }}:${{ steps.date.outputs.date }}
- name: Remove docker context
if: always()
run: docker context rm stunnel
- name: Update Dockerhub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.DOCKERHUB_REPO }}
readme-filepath: README.md
short-description: ${{ github.event.repository.description }}