Skip to content

Commit

Permalink
Add production deloy
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBingman committed Nov 9, 2024
1 parent 2f5ef0a commit 5c52bda
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ jobs:
COMMIT_TAG=$(jq -r .version package.json)-$GITHUB_SHA
echo "COMMIT_TAG=$COMMIT_TAG" >> "$GITHUB_ENV"
docker tag registry.christianbingman.com/personal-site:latest registry.christianbingman.com/personal-site:$COMMIT_TAG
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
docker tag registry.christianbingman.com/personal-site:latest registry.christianbingman.com/personal-site:$COMMIT_TAG
fi
- name: Push image to repo
run: "docker push registry.christianbingman.com/personal-site:$COMMIT_TAG"
- name: Push production image
if: github.ref_type == 'tag'
run: "docker push registry.christianbingman.com/personal-site:$(jq -r .version package.json)"
update-chart:
runs-on: christianbingman-com-runners
needs: container-build
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/tag-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,28 @@ jobs:
check-tag:
runs-on: christianbingman-com-runners
steps:
- run: env

- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
package.json
- name: Check version matches tag
run: |
[[ "$GITHUB_REF_NAME" == "$(jq -r .version package.json)" ]]
- name: Checkout helm repo
uses: actions/checkout@v4
with:
repository: ChristianBingman/christianbingman-com-helm
token: ${{ secrets.HELM_PAT }}
ref: main
path: chart
- name: Update app version
run: |
RELEASE_VERSION=$(jq -r .version package.json)
cd chart
sed -i -e "s/appVersion: \".\"*$/appVersion: \"$RELEASE_VERSION\"/g" Chart.yaml
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git add Chart.yaml
git commit -m "Deploy [prod]"
git push

0 comments on commit 5c52bda

Please sign in to comment.