-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (37 loc) · 1.1 KB
/
deploy-main.yaml
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
# Simple workflow for deploying static content to GitHub Pages
# Copies the main branch to the root of the deployment, and the staging branch into the /staging/ subfolder
name: Deploy
on:
# Runs on pushes targeting the default branch and tags
push:
branches:
- main
- staging
tags:
- "*"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
packages: write
env:
IMAGE_NAME: ghcr.io/esa-earthcode/portal:${{ github.head_ref || github.ref_name }}-${{ github.run_number }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout staging
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- run: npm ci
- run: npm run build --if-present
- name: Build image
run: docker build -t $IMAGE_NAME .
- name: Login ghcr
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push ghcr
run: docker push $IMAGE_NAME