This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
55 lines (45 loc) · 1.52 KB
/
docker-build.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Docker Build and Push
on:
repository_dispatch:
types: [docker-build]
workflow_dispatch:
jobs:
build_push:
name: Build Docker Image and Push to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker Layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: moonstarx
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Version From package.json
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Get Current Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Push to DockerHub
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: moonstarx/discord-music-24-7:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
DATE_CREATED=${{ steps.date.outputs.date }}
VERSION=${{ steps.package-version.outputs.current-version }}
- name: Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}