-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (101 loc) · 2.95 KB
/
deploy.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Player Statically and Push Docker Images
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write
contents: write
pull-requests: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Semver job
semver:
runs-on: ubuntu-latest
outputs:
released: ${{ steps.release.outputs.release_created }}
tag: ${{ steps.release.outputs.tag_name }}
steps:
# Create Release PR
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GH_PAT }}
release-type: node
package-name: yt-dl-ipfs
changelog-notes-type: github
extra-files: |
README.md
build:
if: ${{ needs.semver.outputs.released }}
runs-on: ubuntu-latest
needs: semver
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Checkout Code
- name: Checkout
uses: actions/checkout@v3
# Setup GH Pages
- name: Setup Pages
uses: actions/configure-pages@v2
# Setup Node
- name: Build on Node
uses: actions/setup-node@v3
with:
node-version: 18
# Run BUILD
- run: npm ci
- run: npm run build
# Push NPM Packgae
- run: npm publish
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
# Docker
# Log into Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Setup docker buildx
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Build and Push docker images.
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
file: ci.dockerfile
push: true
tags: |
whizzzkid/yt-dl-ipfs:latest
whizzzkid/yt-dl-ipfs:${{ needs.semver.outputs.tag }}
platforms: |
linux/amd64
linux/arm64
linux/arm/v7
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Push Pages Artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './dist/player/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1