Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:platform-acceleration-lab/cnd-deplo…
Browse files Browse the repository at this point in the history
…y-practices-eduk8s into main
  • Loading branch information
Sang Shin committed Apr 5, 2021
2 parents b2f2518 + ecb356d commit 0cc4615
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release-tag-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Mark Release Image for Environment Deployment
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment'
required: true
default: 'staging'
# work around until release tags are available https://github.community/t/select-tag-release-when-running-workflow-dispatch/132970
version:
description: 'Existing Release Tag'
required: true
default: 'vMajor.Minor.Bugfix'
jobs:
build:
name: Tag
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Login to GitHub Package Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Add environment tag to release and push
env:
VERSION: ${{ steps.extract_tag.outputs.tag }}
run: |
make deploy version=${{ github.event.inputs.version }} environment=${{ github.event.inputs.environment }}
9 changes: 2 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Release
on:
release:
types: [prereleased]
types: [prereleased, published]

jobs:
build:
name: Staging Release
name: Release
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
Expand All @@ -31,11 +31,6 @@ jobs:
VERSION: ${{ steps.extract_tag.outputs.tag }}
run: |
make release version=$VERSION
- name: Publish staging tag to GitHub Package Registry
env:
VERSION: ${{ steps.extract_tag.outputs.tag }}
run: |
make deploy version=$VERSION environment=staging
- name: Prune dangling images
run: docker image prune -f
- name: Upload Release Assets
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ release:
docker push ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version}

deploy:
docker pull ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version}
docker tag ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version} ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${environment}
docker push ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${environment}

Expand Down
4 changes: 2 additions & 2 deletions deploy/platform/educates/workshop-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ spec:
spec:
containers:
- name: nginx
image: ghcr.io/platform-acceleration-lab/cnd-deploy-practices:staging
imagePullPolicy: Always
image: cnd-deploy-practices
imagePullPolicy: IfNotPresent
- apiVersion: v1
kind: Service
metadata:
Expand Down

0 comments on commit 0cc4615

Please sign in to comment.