Skip to content

2108 ssf GitHub workflow standardization (#5) #1

2108 ssf GitHub workflow standardization (#5)

2108 ssf GitHub workflow standardization (#5) #1

Workflow file for this run

# 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
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' }}
TAG: dev
jobs:
docker:
runs-on: ubuntu-latest
steps:
# - name: Random Delay to avoid DDoS behavior against registries.
# run: sleep $((RANDOM % 31))
- name: Checkout repository
uses: actions/[email protected]
- name: List Files
run: ls
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Login to registry1
uses: docker/[email protected]
with:
registry: ${{ env.IB_REGISTRY }}
username: ${{ secrets.IB_USER }}
password: ${{ secrets.IB_PASS }}
- name: Build and push - GHCR
uses: docker/[email protected]
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 }}