-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.54 KB
/
typescript-node-nightly.yml
File metadata and controls
47 lines (40 loc) · 1.54 KB
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
name: TypeScript Node - Nightly
on:
push:
branches: [main]
paths:
- 'source/typescript-node/Dockerfile'
jobs:
build-and-push:
runs-on: ubuntu-latest
environment: STAGING
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Login to Docker Hub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Generate build tag
run: |
TIMESTAMP=$(date +'%Y%m%d')
SHA=$(git rev-parse --short HEAD)
echo "BUILD_TAG=nightly-${TIMESTAMP}-${SHA}" >> $GITHUB_ENV
- name: Build & Push image to registries
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: source/typescript-node
push: true
tags: |
${{ vars.DOCKERHUB_USERNAME }}/typescript-node:${{ env.BUILD_TAG }}
ghcr.io/${{ github.repository_owner }}/typescript-node:${{ env.BUILD_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max