-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 866 Bytes
/
push.yml
File metadata and controls
37 lines (34 loc) · 866 Bytes
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
name: build, test and publish
on:
push:
branches:
- main
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
- run: npm ci
- run: npm run test
deploy:
name: deploy
needs: test
runs-on: ubuntu-latest
steps:
- name: Get Short SHA
id: sha
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ github.repository }}:${{ steps.sha.outputs.sha7 }}