-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use semantic-release action instead of image
- Loading branch information
1 parent
a39280c
commit d7344ce
Showing
1 changed file
with
12 additions
and
49 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,66 +2,29 @@ name: Release | |
|
||
on: workflow_dispatch | ||
|
||
env: | ||
AWS_REGION: us-east-2 | ||
DOCKER_BUILDKIT: 1 | ||
DOCKER_CACHE_PATH: ${{ github.workspace }}/tmp/docker-cache | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
actions: read | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-20.04 | ||
needs: [] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
# A GitHub Action to checkout a repository. | ||
# https://github.com/actions/checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
persist-credentials: false | ||
|
||
- name: Inject slug/short variables | ||
# A GitHub Action to expose the slug values of some GitHub ENV variables | ||
# https://github.com/rlespinasse/github-slug-action | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
role-to-assume: ${{ secrets.DEPLOYER_PRODUCTION_ROLE_ARN }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Create release | ||
semantic_version: 24.0.0 | ||
extra_plugins: | | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_REPOSITORY: scribd/semantic-release | ||
run: | | ||
docker pull $ECR_REGISTRY/$ECR_REPOSITORY:latest | ||
docker run --rm \ | ||
-v ${{ github.workspace }}:/src \ | ||
-w /src \ | ||
-e CI=true \ | ||
-e GITHUB_ACTIONS=true \ | ||
-e GITHUB_TOKEN=${{ secrets.SCRIBD_GITHUB_RELEASE_TOKEN }} \ | ||
-e GITHUB_REPOSITORY=${{ github.repository }} \ | ||
-e GITHUB_WORKSPACE=${{ github.workspace }} \ | ||
-e GITHUB_SHA=${{ github.sha }} \ | ||
-e GITHUB_REF=${{ github.ref }} \ | ||
$ECR_REGISTRY/$ECR_REPOSITORY:latest --publish | ||
- name: Logout of Amazon ECR | ||
if: always() | ||
run: docker logout ${{ steps.login-ecr.outputs.registry }} | ||
GITHUB_TOKEN: ${{ secrets.SCRIBD_GITHUB_GENERIC_TOKEN }} | ||
|
||
- name: Send Slack notification | ||
if: always() | ||
|