diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bfa0f3..a8011cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,51 +25,17 @@ jobs: tags: | ghcr.io/${{ github.repository }}:${{ github.event.release.name }} ghcr.io/${{ github.repository }}:latest - heroku-release: + fly-release: runs-on: ubuntu-latest + needs: + - docker-release strategy: matrix: app: - - eventlite-annewil - - eventlite-occultopus + - journeysurveys steps: - - name: Install Heroku CLI - run: curl https://cli-assets.heroku.com/install.sh | sh - - name: Log in to registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Log into Heroku Container Registry - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} - run: heroku container:login - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - name: Write dockerfiles - run: | - echo "FROM ghcr.io/${{ github.repository }}:${{ github.sha }}" >>Dockerfile.web - echo "FROM ghcr.io/${{ github.repository }}:${{ github.sha }}" >>Dockerfile.release - echo "CMD bundle exec bin/rails db:migrate" >>Dockerfile.release - - name: Build web image - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.web - load: true - platforms: linux/amd64 - tags: registry.heroku.com/${{ matrix.app }}/web - - name: Build release image - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.release - load: true - platforms: linux/amd64 - tags: registry.heroku.com/${{ matrix.app }}/release - - name: Push built images - run: | - docker push registry.heroku.com/${{ matrix.app }}/web - docker push registry.heroku.com/${{ matrix.app }}/release - - name: Perform release + - uses: actions/checkout@v3 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only -a ${{ matrix.app }} env: - HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} - run: heroku container:release -a ${{ matrix.app }} web release + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}