-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (29 loc) · 1009 Bytes
/
CI.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
name: CI
on:
push:
branches:
- 'main'
permissions:
contents: read
packages: write
jobs:
devcontainer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Build
run: |
set -e
FOLDER_WITH_DOT_DEVCONTAINER="devcontainer-sam-terraform"
IMAGE_NAME="devcontainer-sam-terraform"
IMAGE_REPOSITORY="$(echo "ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')"
# [Optional] Enable buildkit, set output to plain text for logging
export DOCKER_BUILDKIT=1
export BUILDKIT_PROGRESS=plain
# Build the image
npm run build -- --no-cache --image-name "${IMAGE_REPOSITORY}" "${FOLDER_WITH_DOT_DEVCONTAINER}"
# Push the image
echo "${{ github.token }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
docker push "${IMAGE_REPOSITORY}"