TravBot-v3/.github/workflows/image.yml

62 lines
1.9 KiB
YAML
Raw Normal View History

2020-12-29 13:12:03 +00:00
name: CodeQL + Docker Image
2020-09-10 18:38:33 +00:00
on:
2020-12-15 01:44:28 +00:00
push:
branches:
- typescript
2020-09-10 18:38:33 +00:00
jobs:
2020-12-29 13:01:02 +00:00
analyze:
2020-12-29 13:12:03 +00:00
name: CodeQL Analysis
2020-12-29 13:01:02 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Node.JS
uses: actions/setup-node@v2
2020-12-29 13:01:02 +00:00
with:
node-version: "14"
# https://github.com/npm/cli/issues/558#issuecomment-580018468
# Error: "npm ERR! fsevents not accessible from jest-haste-map"
# (supposed to just be a warning b/c optional dependency, but CI environment causes it to fail)
2020-12-29 13:01:02 +00:00
- run: npm ci
- name: Build codebase
run: npm run build
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
config-file: ./.github/codeql/codeql-config.yml
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2020-12-15 01:44:28 +00:00
build:
2020-12-29 13:12:03 +00:00
name: Build Docker Image
2020-12-29 13:01:02 +00:00
needs: analyze
2020-12-15 01:44:28 +00:00
runs-on: ubuntu-latest
steps:
2020-12-29 13:12:03 +00:00
- name: Checkout repository
2020-12-15 01:44:28 +00:00
uses: actions/checkout@v2
2020-12-29 13:12:03 +00:00
with:
fetch-depth: 2
2020-12-15 01:44:28 +00:00
- name: Install Docker BuildX
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
2020-12-29 13:12:03 +00:00
2020-12-15 01:44:28 +00:00
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
2020-12-29 13:12:03 +00:00
2020-12-15 01:44:28 +00:00
- name: Build the image
run: |
docker buildx build \
--tag keanucode/travbot-v3:latest \
--platform linux/amd64,linux/arm/v7,linux/arm64 --push .