|
| 1 | +name: build-and-push-bskyweb-docr |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +jobs: |
| 9 | + bskyweb-container-docr: |
| 10 | + if: github.repository == 'blacksky-algorithms/blacksky.community' |
| 11 | + runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout repository |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Setup Docker buildx |
| 20 | + uses: docker/setup-buildx-action@v3 |
| 21 | + |
| 22 | + - name: Install doctl |
| 23 | + uses: digitalocean/action-doctl@v2 |
| 24 | + with: |
| 25 | + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |
| 26 | + |
| 27 | + - name: Log into DOCR |
| 28 | + run: doctl registry login --expiry-seconds 600 |
| 29 | + |
| 30 | + - name: Extract Docker metadata |
| 31 | + id: meta |
| 32 | + uses: docker/metadata-action@v5 |
| 33 | + with: |
| 34 | + images: | |
| 35 | + registry.digitalocean.com/blacksky/blacksky-community |
| 36 | + tags: | |
| 37 | + type=sha,enable=true,priority=100,prefix=,suffix=,format=long |
| 38 | +
|
| 39 | + - name: Env |
| 40 | + id: env |
| 41 | + run: | |
| 42 | + echo "EXPO_PUBLIC_RELEASE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT |
| 43 | + echo "EXPO_PUBLIC_BUNDLE_IDENTIFIER=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT |
| 44 | +
|
| 45 | + - name: Build and push Docker image |
| 46 | + id: build-and-push |
| 47 | + uses: docker/build-push-action@v5 |
| 48 | + with: |
| 49 | + context: . |
| 50 | + push: true |
| 51 | + file: ./Dockerfile |
| 52 | + platforms: linux/amd64 |
| 53 | + tags: ${{ steps.meta.outputs.tags }} |
| 54 | + labels: ${{ steps.meta.outputs.labels }} |
| 55 | + cache-from: type=gha |
| 56 | + cache-to: type=gha,mode=max |
| 57 | + build-args: | |
| 58 | + EXPO_PUBLIC_ENV=production |
| 59 | + EXPO_PUBLIC_RELEASE_VERSION=${{ steps.env.outputs.EXPO_PUBLIC_RELEASE_VERSION }} |
| 60 | + EXPO_PUBLIC_BUNDLE_IDENTIFIER=${{ steps.env.outputs.EXPO_PUBLIC_BUNDLE_IDENTIFIER }} |
| 61 | + EXPO_PUBLIC_METRICS_API_HOST=${{ secrets.EXPO_PUBLIC_METRICS_API_HOST }} |
| 62 | + EXPO_PUBLIC_GROWTHBOOK_API_HOST=${{ secrets.EXPO_PUBLIC_GROWTHBOOK_API_HOST }} |
| 63 | + EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY=${{ secrets.EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY }} |
| 64 | + EXPO_PUBLIC_STRIPE_API_URL=${{ secrets.EXPO_PUBLIC_STRIPE_API_URL }} |
| 65 | + EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=${{ secrets.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY }} |
0 commit comments