-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (38 loc) · 2.84 KB
/
docker-latest.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
name: Docker push develop to latest
on:
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Convert Username
id: un
run: echo "un=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ steps.un.outputs.un }}
password: ${{ github.token }}
- name: Push develop to latest
run: |
docker buildx imagetools create --tag ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }}
docker buildx imagetools create --tag ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:dns ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:dns-${{ github.ref_name }}
docker buildx imagetools create --tag ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}-dns:latest ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}-dns:${{ github.ref_name }}
docker buildx imagetools create --tag ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }}
docker buildx imagetools create --tag ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:dns ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:dns-${{ github.ref_name }}
docker buildx imagetools create --tag ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}-dns:latest ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}-dns:${{ github.ref_name }}
- name: show version
run: |
docker run --rm --entrypoint cloudflared ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest version
docker run --rm --entrypoint cloudflared ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:dns version
docker run --rm --entrypoint cloudflared ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}-dns:latest version
docker run --rm --entrypoint cloudflared ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest version
docker run --rm --entrypoint cloudflared ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:dns version
docker run --rm --entrypoint cloudflared ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}-dns:latest version