-
Notifications
You must be signed in to change notification settings - Fork 6
121 lines (104 loc) · 3.85 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Deploy to GitHub Pages
on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Allow this job to clone the repo and create a page deployment
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
repository-projects: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
FORMSPREE: ${{ secrets.FORMSPREE }}
PBOT_GITHUB_TOKEN: ${{ secrets.PBOT_GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Install Tools & Dependencies
uses: ./.github/actions/install
- name: 🔍 PBOT_GITHUB_TOKEN
if: env.PBOT_GITHUB_TOKEN == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "PBOT_GITHUB_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
- name: 🚀 🟣 Release to GitHub
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ env.PBOT_GITHUB_TOKEN }}
- name: Install, build, and upload your site
uses: withastro/action@v1
with:
# path: . # The root location of your Astro project inside the repository. (optional)
# node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
env:
FORMSPREE: ${{ secrets.FORMSPREE }}
outputs:
revnumber: ${{ env.revnumber }}
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
env:
FORMSPREE: ${{ secrets.FORMSPREE }}
deploy-container-image:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Install Tools & Dependencies
uses: ./.github/actions/install
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ env.PBOT_GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9dc751fe249ad99385a2583ee0d084c400eee04e
with:
images: |
n4t5u/yacosta738.github.io
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
latest
${{ github.sha }}
${{ github.sha }}-${{ github.run_number }}
labels: |
org.opencontainers.image.source= ${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.run_id }}
org.opencontainers.image.authors=${{ github.actor }}
- name: Build the container image
run: pnpm run build # build:docker
- name: Build and push Docker image
uses: docker/build-push-action@9f6f8c940b91232557f8699b21341a08624a8dce
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}