Skip to content

Commit 2645885

Browse files
rokeppenKoen De Voegt
authored andcommitted
T5753 - Github actions
1 parent 4982ea4 commit 2645885

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build and deploy to Ansible
2+
run-name: >
3+
"${{ github.event.head_commit.message }}" ${{ github.event_name }}ed by ${{ github.actor }}
4+
5+
on:
6+
push:
7+
branches:
8+
- production
9+
- staging
10+
- kdv/dev
11+
- tvl/dev
12+
- rokeppen/githubWorkflow
13+
14+
jobs:
15+
build-and-deploy:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v5
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v5
23+
with:
24+
node-version: '12'
25+
26+
- name: Install dependencies
27+
run: |
28+
npm ci --ignore-scripts
29+
npx browserslist@latest --update-db
30+
31+
- name: Build frontend
32+
run: npm run build
33+
34+
- name: Copy TinyMCE minified files
35+
run: |
36+
mkdir -p dist/js
37+
cp -r node_modules/tinymce/*.min.js node_modules/tinymce/*/ dist/js/ || true
38+
39+
- name: Create frontend.zip
40+
run: zip -r frontend.zip dist/*
41+
42+
- name: Upload zip to Github
43+
uses: actions/upload-artifact@v5
44+
with:
45+
name: frontend-build
46+
path: frontend.zip
47+
48+
- name: Activate deploy
49+
uses: appleboy/ssh-action@v1
50+
env:
51+
BRANCH_NAME: ${{ github.ref_name }}
52+
with:
53+
proxy_host: ${{ secrets.SSHHOST }}
54+
proxy_username: ${{ secrets.SSHUSER }}
55+
proxy_key: ${{ secrets.SSHKEY }}
56+
proxy_port: ${{ secrets.SSHPORT }}
57+
host: az-deb-mgmt
58+
username: ${{ secrets.SSHUSER }}
59+
key: ${{ secrets.SSHKEY }}
60+
envs: BRANCH_NAME
61+
script: |
62+
echo "Github trigger for branch $BRANCH_NAME"
63+
sudo -u ansible /opt/deploy-ga.sh frontend ${BRANCH_NAME}

0 commit comments

Comments
 (0)