Skip to content

Commit

Permalink
Close #59 Update Create Release commit message to be more descriptive.
Browse files Browse the repository at this point in the history
  • Loading branch information
trackleft committed May 3, 2024
1 parent 912de20 commit c3293d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/cdn-deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@ on:
push:
branches:
- main

jobs:
deploy:
name: Build & deploy CDN assets
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Deploy CDN assets to S3 + CloudFront
run: |
aws s3 sync --delete --cache-control max-age=691200 dist/. s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/main/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/az-icons/main/*
14 changes: 1 addition & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}

- name: Set variables for Docker images
run: |
oldhash=${{ hashFiles('Dockerfile', 'package.json', 'package-lock.json', 'scripts/*') }}
Expand All @@ -28,14 +27,11 @@ jobs:
echo "AZ_IMAGE_STEM=${imagestem}" >> ${GITHUB_ENV}
echo "AZ_ICONS_SOURCE_DIR=/az-icons-src" >> ${GITHUB_ENV}
echo "AZ_ICONS_FROZEN_DIR=/azbuild/az-icons" >> ${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker authentication
run: |
docker login "$AZ_DOCKER_REGISTRY" -u "$GITHUB_ACTOR" -p ${{ secrets.GITHUB_TOKEN }}
- name: Unconditionally rebuild and save the Docker image
run: |
workingtitle=$(docker build -q . )
Expand All @@ -48,11 +44,9 @@ jobs:
docker tag "$workingtitle" "$ephemeral"
docker push "$ephemeral"
echo "AZ_EPHEMERAL_IMAGE=${ephemeral}" >> ${GITHUB_ENV}
- name: Build variables
run: |
echo "AZ_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV}
- name: Update version
run: |
sudo touch config.yml
Expand All @@ -62,10 +56,9 @@ jobs:
git config --global user.name "${GITHUB_ACTOR}"
docker run --rm -e "AZ_RELEASE_VERSION=${AZ_VERSION}" -v $(pwd):"${AZ_ICONS_SOURCE_DIR}" "$AZ_EPHEMERAL_IMAGE" create-release
git add dist package.json package-lock.json
git commit -m '${{ github.event.inputs.version }}'
git commit -m 'Bump version of `az-icons` to `${AZ_VERSION}` for release.'
git push
echo "RELEASE_SHA=$(git rev-parse HEAD)" >> ${GITHUB_ENV}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
Expand All @@ -78,17 +71,14 @@ jobs:
prerelease: false
body: |
Release v${{ env.AZ_VERSION }}
- name: Save new SHA to file
run: |
echo "{\"sha\": \"$(git rev-parse HEAD)\"}" > ${{ runner.temp }}/variables.json
- name: Upload variables
uses: actions/upload-artifact@v4
with:
name: variables-json-artifact
path: ${{ runner.temp }}

dispatch:
needs: release
strategy:
Expand All @@ -103,13 +93,11 @@ jobs:
with:
name: variables-json-artifact
path: ${{ runner.temp }}

- name: Update environment variables
run: |
variablesfile=${{ runner.temp }}/variables.json
echo "RELEASE_SHA=$(cat ${variablesfile} | jq -r '.sha' )" >> ${GITHUB_ENV}
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> ${GITHUB_ENV}
- name: Notify dependencies
uses: peter-evans/repository-dispatch@v3
with:
Expand Down

0 comments on commit c3293d3

Please sign in to comment.