forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 2.31 KB
/
dev-push.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
# This workflow is managed by https://github.com/raft-tech/df-gh-templates. All attempts to edit outside of df-gh-templates will be futile.
name: DEV - Build and Push 'dev' Docker Image
on:
push:
branches:
- dev
paths-ignore:
- 'VERSION'
env:
GHCR_REGISTRY: ghcr.io
GHCR_REPOSITORY: raft-tech
IB_REGISTRY: registry1.dso.mil
IMAGE_NAME: ${{ vars.IMAGE_NAME }}
CONTEXT_PATH: ${{ vars.CONTEXT_PATH || '.' }}
DOCKERFILE_PATH: ${{ vars.DOCKERFILE_PATH || 'Dockerfile' }}
OPTIONAL_TAG: ${{ vars.OPTIONAL_TAG }}
TAG: dev
jobs:
docker:
runs-on: ${{ vars.DOCKER_JOBS_RUNS_ON || 'ubuntu-latest' }}
steps:
# - name: Random Delay to avoid DDoS behavior against registries.
# run: sleep $((RANDOM % 31))
- name: Checkout repository
uses: actions/checkout@v4
- name: List Files
run: ls
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to registry1
uses: docker/login-action@v3
with:
registry: ${{ env.IB_REGISTRY }}
username: ${{ secrets.IB_USER }}
password: ${{ secrets.IB_PASS }}
- name: Build and push - GHCR
if: env.OPTIONAL_TAG == ''
uses: docker/build-push-action@v5
with:
context: ${{ env.CONTEXT_PATH }}
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Build and push - GHCR (Optional Tag)
if: env.OPTIONAL_TAG != ''
uses: docker/build-push-action@v5
with:
context: ${{ env.CONTEXT_PATH }}
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.OPTIONAL_TAG }}