-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule.yml
54 lines (52 loc) · 1.63 KB
/
schedule.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Container Scan
on:
schedule:
- cron: '0 10 * * 1'
workflow_dispatch:
env:
GOOGLE_CLOUD_PROJECT_ID: project_id_goes_here
jobs:
docker:
name: Docker
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
env:
IMAGE_NAME: container
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN_SECRET_NAME_GOES_HERE }}'
steps:
- name: Checkout
uses: actions/[email protected]
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Authenticate Google Cloud Platform
uses: google-github-actions/[email protected]
with:
access_token_lifetime: 600s
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_NAME_GOES_HERE }}
workload_identity_provider:
${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER_NAME_GOES_HERE }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
install_components: 'local-extract'
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
- name: Build
run: |
docker build \
--build-arg GITHUB_TOKEN=$GITHUB_TOKEN \
--tag ${{ env.IMAGE_NAME }} \
.
env:
DOCKER_BUILDKIT: 1
- name: Container Scan
uses: ridedott/container-scan@master
with:
containerTag: ${{ env.IMAGE_NAME }}
slackWebhook: ${{ secrets.CONTAINER_SCAN_SLACK_WEBHOOK }}
githubUrl:
'${{ github.server_url }}/${{ github.repository }}/actions/runs/${{
github.run_id }}'
timeout-minutes: 10