2022-02-04 21:24:11 +01:00
|
|
|
name: Docker Image CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
# Checkout the Repo
|
2022-03-02 03:42:47 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-04 21:24:11 +01:00
|
|
|
|
|
|
|
# Install Node 16
|
|
|
|
- name: Setup Node
|
2022-10-14 04:21:37 +02:00
|
|
|
uses: actions/setup-node@v3.5.1
|
2022-02-04 21:24:11 +01:00
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
|
|
|
|
# Avoid running prepublish script
|
|
|
|
- run: npm set-script prepublish ""
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
- run: npm install
|
|
|
|
|
|
|
|
# Run tests
|
|
|
|
- run: npm test
|
|
|
|
|
|
|
|
build:
|
|
|
|
if: startsWith(github.event.ref, 'refs/tags')
|
|
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2022-05-08 13:32:17 +02:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-02-04 21:24:11 +01:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-05-08 13:32:17 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-02-04 21:24:11 +01:00
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
2022-05-08 13:32:17 +02:00
|
|
|
uses: docker/login-action@v2
|
2022-02-04 21:24:11 +01:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Build and push
|
2023-01-31 03:03:14 +01:00
|
|
|
uses: docker/build-push-action@v4
|
2022-02-04 21:24:11 +01:00
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
tags: wolvan/poll.horse:latest
|