|
15 | 15 | name: Build and push Docker image to GCP Artifact Registry |
16 | 16 |
|
17 | 17 | on: |
18 | | - workflow_dispatch: |
19 | | - push: |
20 | | - branches: |
21 | | - - main |
| 18 | + workflow_dispatch: |
| 19 | + push: |
| 20 | + branches: |
| 21 | + - main |
| 22 | + schedule: |
| 23 | + # Every Monday at 1PM UTC (9AM EST) |
| 24 | + - cron: "0 13 * * 1" |
22 | 25 |
|
23 | 26 | jobs: |
24 | 27 | build-and-push: |
25 | 28 | runs-on: ubuntu-latest |
26 | 29 |
|
27 | 30 | steps: |
| 31 | + - name: Free Disk Space (Ubuntu) |
| 32 | + uses: jlumbroso/free-disk-space@main |
| 33 | + with: |
| 34 | + # this might remove tools that are actually needed, |
| 35 | + # if set to "true" but frees about 6 GB |
| 36 | + tool-cache: false |
| 37 | + |
| 38 | + android: true |
| 39 | + dotnet: true |
| 40 | + haskell: true |
| 41 | + large-packages: false |
| 42 | + docker-images: true |
| 43 | + swap-storage: true |
28 | 44 | - name: Checkout |
29 | 45 | uses: actions/checkout@v3 |
30 | | - - name: Authenticate to Google Cloud |
| 46 | + - id: "auth" |
| 47 | + name: Authenticate to Google Cloud |
31 | 48 | uses: google-github-actions/auth@v1.1.1 |
32 | 49 | with: |
33 | 50 | credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} |
34 | 51 | token_format: access_token |
35 | | - - name: Docker login - |
36 | | - uses: 'docker/login-action@v1' |
| 52 | + - name: Docker login |
| 53 | + uses: "docker/login-action@v1" |
37 | 54 | with: |
38 | | - registry: 'us-docker.pkg.dev' |
39 | | - username: 'oauth2accesstoken' |
40 | | - password: '${{ steps.auth.outputs.access_token }}' |
| 55 | + registry: "us-docker.pkg.dev" |
| 56 | + username: "oauth2accesstoken" |
| 57 | + password: "${{ steps.auth.outputs.access_token }}" |
| 58 | + - name: Set up Python 3.8 |
| 59 | + uses: actions/setup-python@v4 |
| 60 | + with: |
| 61 | + python-version: "3.8" |
41 | 62 | - name: Init env |
42 | 63 | run: | |
43 | | - cp tests/sample.env.tf .env |
44 | | - echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev |
45 | | - make init |
| 64 | + cp tests/sample.env.tf .env |
| 65 | + echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev |
| 66 | + make init |
46 | 67 | - name: Build and push Docker image |
47 | 68 | run: | |
48 | 69 | make docker |
| 70 | + - name: Test Docker image |
| 71 | + run: | |
| 72 | + make run-df-gpu |
0 commit comments