File tree Expand file tree Collapse file tree 1 file changed +41
-10
lines changed
Expand file tree Collapse file tree 1 file changed +41
-10
lines changed Original file line number Diff line number Diff line change 1- name : Docker Image CI
1+ name : Docker CI/CD Pipeline
22
33on :
44 push :
5- branches : [ "master" ]
6- pull_request :
7- branches : [ "master" ]
5+ branches :
6+ - main
7+ - develop
8+ tags :
9+ - ' version-*'
10+ schedule :
11+ - cron : ' 0 0 1 * *'
12+ workflow_dispatch :
813
914jobs :
10-
1115 build :
12-
1316 runs-on : ubuntu-latest
14-
17+ outputs :
18+ image : ${{ steps.docker_build.outputs.image }}
1519 steps :
16- - uses : actions/checkout@v4
17- - name : Build the Docker image
18- run : docker build ./src/ --file ./src/Dockerfile --tag cloudflare-tunnel:$(date +%s)
20+ - name : Checkout repository
21+ uses : actions/checkout@v2
22+
23+ - name : Set up QEMU
24+ uses : docker/setup-qemu-action@v2
25+ with :
26+ platforms : all
27+
28+ - name : Set up Docker Buildx
29+ uses : docker/setup-buildx-action@v2
30+
31+ - name : Cache Docker layers
32+ uses : actions/cache@v2
33+ with :
34+ path : /tmp/.buildx-cache
35+ key : ${{ runner.os }}-buildx-${{ github.sha }}
36+ restore-keys : |
37+ ${{ runner.os }}-buildx-
38+
39+ - name : Build Docker image
40+ id : docker_build
41+ uses : docker/build-push-action@v3
42+ with :
43+ context : .
44+ load : true
45+ outputs : type=docker
46+ tags : |
47+ ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
48+ ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/version-') && 'ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.ref_name }}' }}
49+ platforms : linux/amd64,linux/arm64
You can’t perform that action at this time.
0 commit comments