Skip to content

Commit

Permalink
Update image-template.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tmknight committed Jan 20, 2024
1 parent 765e17d commit b4e3f6d
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions .github/workflows/image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,26 @@ on:
default: false

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ${{ github.event.inputs.registry }}
USERNAME: |
if: ${{ github.event.inputs.registry == 'ghcr.io' }} ${{ github.actor }}
if: ${{ github.event.inputs.registry == 'docker.io' }} ${{ secrets.DOCKERHUB_USERNAME }}
PASSWORD: |
if: ${{ github.event.inputs.registry == 'ghcr.io' }} ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event.inputs.registry == 'docker.io' }} ${{ secrets.DOCKERHUB_TOKEN }}
# name of image
IMAGE: privoxy
# github.repository as <account>/<repo>
# repository as <account>/<repo>
IMAGE_NAME: ${{ github.event.inputs.username }}/privoxy
# Build args
CONTEXT: .
DISTRO: ${{ github.event.inputs.distro }}
RELEASE: ${{ github.event.inputs.release }}
BUILD_ARGS: |
if: ${{ github.event.inputs.distro == 'alpine' }}
"ALPINE_VER=${{ vars.ALPINE_VER }}"
if: ${{ github.event.inputs.distro == 'ubuntu' }}
"UBUNTU_VER=${{ vars.UBUNTU_VER }}"
if: ${{ github.event.inputs.release == 'stable' }}
"PRIVOXY_VER=3.0.34"
if: ${{ github.event.inputs.release == 'edge' }}
"PRIVOXY_VER=3.0.35"
if: ${{ github.event.inputs.distro == 'alpine' }} "ALPINE_VER=${{ vars.ALPINE_VER }}"
if: ${{ github.event.inputs.distro == 'ubuntu' }} "UBUNTU_VER=${{ vars.UBUNTU_VER }}"
if: ${{ github.event.inputs.release == 'stable' }} "PRIVOXY_VER=3.0.34"
if: ${{ github.event.inputs.release == 'edge' }} "PRIVOXY_VER=3.0.35"
jobs:
build:
Expand Down Expand Up @@ -107,16 +108,8 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: |
if: ${{ env.REGISTRY == 'ghcr.io' }}
${{ github.actor }}
if: ${{ env.REGISTRY == 'docker.io' }}
${{ secrets.DOCKERHUB_USERNAME }}
password: |
if: ${{ env.REGISTRY == 'ghcr.io' }}
${{ secrets.GITHUB_TOKEN }}
if: ${{ env.REGISTRY == 'docker.io' }}
${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
Expand Down

0 comments on commit b4e3f6d

Please sign in to comment.