-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from MitchTalmadge/staging
v22 Release
- Loading branch information
Showing
11 changed files
with
381 additions
and
344 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,54 @@ | ||
name: "Deploy Production" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
git_release_version: | ||
required: true | ||
type: string | ||
amp_core_version: | ||
required: true | ||
type: string | ||
amp_instmgr_version: | ||
required: true | ||
type: string | ||
amp_last_modified: | ||
required: true | ||
type: string | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
push: | ||
branches: | ||
- "master" | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
for_deploy: true | ||
|
||
deploy: | ||
name: "Deploy" | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: "Download Docker Image Artifacts" | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: /tmp | ||
- name: "Load Docker Image" | ||
- name: "Get Tag Name" | ||
id: get_tag_name | ||
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | ||
- name: "Load Docker Images" | ||
id: load_images | ||
run: | | ||
for f in $(find /tmp -type f -iname 'docker-image*.tar' -print); do | ||
TAGS="" | ||
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:${{ steps.get_tag_name.outputs.TAG_NAME }}-${ARCH}" | ||
TAGS="${TAGS} ${TAG}" | ||
docker tag amp-dockerized:latest ${TAG} | ||
done | ||
echo "TAGS=${TAGS}" >> $GITHUB_OUTPUT | ||
docker image ls -a | ||
- name: "Tag Docker Images" | ||
run: | | ||
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:latest | ||
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:${{inputs.git_release_version}} | ||
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:${{inputs.git_release_version}}-ampcore${{inputs.amp_core_version}}-ampinstmgr${{inputs.amp_instmgr_version}} | ||
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:${{inputs.git_release_version}}-ampcore${{inputs.amp_core_version}}-ampinstmgr${{inputs.amp_instmgr_version}}-${{inputs.amp_last_modified}} | ||
- name: "Checkout Git Repo" | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: "Commit Git Tag" | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
TAG=${{inputs.git_release_version}}-ampcore${{inputs.amp_core_version}}-ampinstmgr${{inputs.amp_instmgr_version}}-${{inputs.amp_last_modified}} | ||
git tag -a "${TAG}" -m "Auto Release Latest AMP Version" || { echo "Tag already exists"; exit; } | ||
git push --follow-tags | ||
- name: "Login to Docker Hub" | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: "Deploy to Docker Hub" | ||
run: docker image push --all-tags mitchtalmadge/amp-dockerized | ||
- name: "Deploy Multi-Arch Manifests" | ||
run: | | ||
MANIFESTS="mitchtalmadge/amp-dockerized:latest mitchtalmadge/amp-dockerized:${{ steps.get_tag_name.outputs.TAG_NAME }}" | ||
for m in ${MANIFESTS}; do | ||
docker manifest create ${m} ${{ steps.load_images.outputs.TAGS }} | ||
docker manifest push ${m} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,55 @@ | ||
name: "Deploy Staging" | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
push: | ||
branches: | ||
- "staging*" | ||
paths: | ||
- Dockerfile | ||
- .dockerignore | ||
- entrypoint/** | ||
- .github/workflows/**.yml | ||
|
||
jobs: | ||
build: | ||
if: ${{ startsWith(github.ref, 'refs/heads/staging') }} | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
for_deploy: true | ||
|
||
deploy: | ||
name: "Deploy Staging" | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: "Download Docker Image Artifacts" | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: /tmp | ||
- name: "Load Docker Images" | ||
id: load_images | ||
run: | | ||
for f in $(find /tmp -type f -iname 'docker-image*.tar' -print); do | ||
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}" | ||
TAGS="${TAGS} ${TAG}" | ||
docker tag amp-dockerized:latest ${TAG} | ||
done | ||
echo "TAGS=${TAGS}" >> $GITHUB_OUTPUT | ||
docker image ls -a | ||
- name: "Extract Branch Name" | ||
id: extract_branch | ||
run: echo "::set-output name=name::$(echo ${GITHUB_REF#refs/heads/})" | ||
- name: "Tag Docker Image" | ||
run: docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:${{ steps.extract_branch.outputs.name }} | ||
- name: "Login to Docker Hub" | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: "Deploy to Docker Hub" | ||
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}" | ||
docker manifest create ${MANIFEST} ${{ steps.load_images.outputs.TAGS }} | ||
docker manifest push ${MANIFEST} |
Oops, something went wrong.