Skip to content

Commit

Permalink
Merge pull request #190 from MitchTalmadge/master
Browse files Browse the repository at this point in the history
Master into Staging
  • Loading branch information
MitchTalmadge authored Feb 14, 2024
2 parents d3c25a0 + 24fb272 commit c949550
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- "master"
tags:
- v*
workflow_dispatch:
inputs:
tag:
required: true
description: e.g. v22

jobs:
build:
Expand All @@ -24,7 +29,12 @@ jobs:
path: /tmp
- name: "Get Tag Name"
id: get_tag_name
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.tag }}" != "" ]]; then
echo "TAG_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
fi
- name: "Load Docker Images"
id: load_images
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ jobs:
uses: actions/download-artifact@v2
with:
path: /tmp
- name: "Get Branch Name"
id: get_branch_name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
- name: "Load Docker Images"
id: load_images
run: |
TAGS=""
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})
for f in $(find /tmp -type f -iname 'docker-image-*.tar' -print); do
ARCH=$(echo ${f} | sed -E 's/.*docker-image-(.*).tar/\1/')
docker load --input ${f}
TAG="mitchtalmadge/amp-dockerized:${BRANCH_NAME}-${ARCH}"
TAG="mitchtalmadge/amp-dockerized:${{ steps.get_branch_name.outputs.BRANCH_NAME }}-${ARCH}"
TAGS="${TAGS} ${TAG}"
docker tag amp-dockerized:latest ${TAG}
done
Expand All @@ -49,7 +51,6 @@ jobs:
run: docker image push --all-tags mitchtalmadge/amp-dockerized
- name: "Deploy Multi-Arch Manifest"
run: |
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})
MANIFEST="mitchtalmadge/amp-dockerized:${BRANCH_NAME}"
MANIFEST="mitchtalmadge/amp-dockerized:${{ steps.get_branch_name.outputs.BRANCH_NAME }}"
docker manifest create ${MANIFEST} ${{ steps.load_images.outputs.TAGS }}
docker manifest push ${MANIFEST}

0 comments on commit c949550

Please sign in to comment.