Skip to content

Commit

Permalink
chore: Use semantic-release action instead of image
Browse files Browse the repository at this point in the history
  • Loading branch information
basmscribd committed Jan 13, 2025
1 parent a39280c commit d7344ce
Showing 1 changed file with 12 additions and 49 deletions.
61 changes: 12 additions & 49 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d7344ce

Please sign in to comment.