-
-
Save igor-alexandrov/8a9e997b4c33c18f9c17f4f7b551246d to your computer and use it in GitHub Desktop.
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
name: MRSK | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
outputs: | |
image: ${{ steps.build.outputs.image }} | |
env: | |
RAILS_ENV: production | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.workflow_run.head_branch }} | |
- uses: webfactory/ssh-agent@v0.7.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- uses: ruby/setup-ruby@v1 | |
env: | |
BUNDLE_GEMFILE: ./gemfiles/mrsk.gemfile | |
with: | |
ruby-version: 3.1.2 | |
bundler-cache: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver-opts: image=moby/buildkit:master | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region : us-east-1 | |
mask-aws-account-id : 'no' | |
- name: Login to Amazon ECR | |
id : login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: MRSK | |
id : mrsk | |
env : | |
MRSK_REGISTRY_PASSWORD: ${{ steps.login-ecr.outputs.docker_password_<YOUR_AWS_ACCOUNT_ID>_dkr_ecr_us_east_1_amazonaws_com }} | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
REDIS_URL: ${{ secrets.REDIS_URL }} | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
DOCKER_BUILDKIT: 1 | |
BUNDLE_GEMFILE: ./gemfiles/mrsk.gemfile | |
run: | | |
bundle exec mrsk deploy | |
timeout-minutes: 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment