-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (64 loc) · 2.04 KB
/
release.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Release
on:
push:
tags:
- 'v*'
env:
BWS_DOCKERHUB_USERNAME: ebf9ede7-b7eb-422f-a590-b16c014a70a3
BWS_DOCKERHUB_TOKEN: 0fa21e12-63ae-4793-a9a5-b16c014aa15d
IMAGE_TAG: adnanjaw/cronned-rclone
LATEST_TAG: 'latest'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Fetch Secrets From Bitwarden
uses: bitwarden/sm-action@v2.0.0
with:
access_token: ${{ secrets.BWS_TOKEN }}
secrets: |
${{ env.BWS_DOCKERHUB_USERNAME }} > DOCKERHUB_USERNAME
${{ env.BWS_DOCKERHUB_TOKEN }} > DOCKERHUB_TOKEN
- name: Set Up QEMU for Multi-Platform Builds
uses: docker/setup-qemu-action@v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image for Testing
uses: docker/build-push-action@v5
with:
context: .
load: true # Load the image locally to test it
tags: ${{ env.IMAGE_TAG }}:${{ env.LATEST_TAG }}
push:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Fetch Secrets From Bitwarden
uses: bitwarden/sm-action@v2.0.0
with:
access_token: ${{ secrets.BWS_TOKEN }}
secrets: |
${{ env.BWS_DOCKERHUB_USERNAME }} > DOCKERHUB_USERNAME
${{ env.BWS_DOCKERHUB_TOKEN }} > DOCKERHUB_TOKEN
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Push Latest Tag
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.IMAGE_TAG }}:${{ env.LATEST_TAG }}
- name: Push Versioned Tag
if: github.ref_type == 'tag'
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.IMAGE_TAG }}:${{ github.ref_name }}