chore: get all pageCount or previewable page count in creator issue s… #865
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: Deploy | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
workflow_dispatch: | |
jobs: | |
docker_build: | |
name: Docker build | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: docker_build | |
strategy: | |
matrix: | |
solana-cluster: [devnet, mainnet] | |
fail-fast: false | |
environment: | |
name: ${{ github.ref_name }}-${{ matrix.solana-cluster }} | |
url: https://api-${{ github.ref_name }}-${{ matrix.solana-cluster }}.dreader.io | |
concurrency: | |
group: ${{ github.ref_name }}-${{ matrix.solana-cluster }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3' | |
bundler-cache: true | |
- name: Setup mrsk | |
run: | | |
gem install mrsk | |
- name: Setup sops | |
uses: mdgreenwald/mozilla-sops-action@v1.4.1 | |
- name: Setup age | |
run: | | |
mkdir -p ~/.config/sops/age | |
echo "$AGE_SECRET_KEY" > ~/.config/sops/age/keys.txt | |
env: | |
AGE_SECRET_KEY: ${{ secrets.AGE_SECRET_KEY }} | |
- name: Setup ssh-agent | |
run: | | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
- name: Run mrsk | |
run: | | |
./config/scripts/mrsk.sh $ENV lock release | |
./config/scripts/mrsk.sh $ENV deploy --roles web --skip-push | |
env: | |
ENV: ${{ github.ref_name }}-${{ matrix.solana-cluster }} | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
- name: Cleanup old docker images | |
continue-on-error: true | |
run: | | |
./config/scripts/ssh.sh $ENV docker image prune -a --filter "until=48h" -f | |
env: | |
ENV: ${{ github.ref_name }}-${{ matrix.solana-cluster }} | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock |