|
| 1 | +name: Build & Publish App Compiler |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [ master ] |
| 5 | + paths: |
| 6 | + - 'app/**' |
| 7 | + - 'services/app-compiler/**' |
| 8 | + - 'Cargo.*' |
| 9 | + - '.github/workflows/build-publish-app-compiler.yml' |
| 10 | + |
| 11 | +jobs: |
| 12 | + app: |
| 13 | + name: Build and publish app |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - name: Set up QEMU |
| 18 | + uses: docker/setup-qemu-action@v1 |
| 19 | + |
| 20 | + - name: Set up Docker Buildx |
| 21 | + uses: docker/setup-buildx-action@v1 |
| 22 | + |
| 23 | + - id: 'auth' |
| 24 | + name: 'Authenticate to Google Cloud' |
| 25 | + uses: 'google-github-actions/auth@v0' |
| 26 | + with: |
| 27 | + token_format: 'access_token' |
| 28 | + credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' |
| 29 | + |
| 30 | + - name: Login to Google Artifacts Registry |
| 31 | + uses: docker/login-action@v1 |
| 32 | + with: |
| 33 | + registry: us-docker.pkg.dev/ |
| 34 | + username: oauth2accesstoken |
| 35 | + password: ${{ steps.auth.outputs.access_token }} |
| 36 | + |
| 37 | + - name: Build and push |
| 38 | + id: docker_build |
| 39 | + uses: docker/build-push-action@v2 |
| 40 | + with: |
| 41 | + context: app |
| 42 | + push: true |
| 43 | + tags: us-docker.pkg.dev/yew-rs/yew-playground/app:latest |
| 44 | + |
| 45 | + - name: Image digest |
| 46 | + run: echo ${{ steps.docker_build.outputs.digest }} |
| 47 | + |
| 48 | + compiler: |
| 49 | + name: Build & publish app compiler |
| 50 | + runs-on: ubuntu-latest |
| 51 | + needs: |
| 52 | + - app |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v2 |
| 55 | + |
| 56 | + - name: Set up QEMU |
| 57 | + uses: docker/setup-qemu-action@v1 |
| 58 | + |
| 59 | + - name: Set up Docker Buildx |
| 60 | + uses: docker/setup-buildx-action@v1 |
| 61 | + |
| 62 | + - id: 'auth' |
| 63 | + name: 'Authenticate to Google Cloud' |
| 64 | + uses: 'google-github-actions/auth@v0' |
| 65 | + with: |
| 66 | + token_format: 'access_token' |
| 67 | + credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' |
| 68 | + |
| 69 | + - name: Login to Google Artifacts Registry |
| 70 | + uses: docker/login-action@v1 |
| 71 | + with: |
| 72 | + registry: us-docker.pkg.dev/ |
| 73 | + username: oauth2accesstoken |
| 74 | + password: ${{ steps.auth.outputs.access_token }} |
| 75 | + |
| 76 | + - name: Build and push |
| 77 | + id: docker_build |
| 78 | + uses: docker/build-push-action@v2 |
| 79 | + with: |
| 80 | + context: services/app-compiler |
| 81 | + push: true |
| 82 | + tags: us-docker.pkg.dev/yew-rs/yew-playground/playground-compiler:latest |
| 83 | + |
| 84 | + - name: Image digest |
| 85 | + run: echo ${{ steps.docker_build.outputs.digest }} |
| 86 | + |
| 87 | + - name: Deploy URL |
| 88 | + run: echo ${{ steps.deploy.outputs.url }} |
0 commit comments