Skip to content

Commit

Permalink
add landing scripts and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kar committed Feb 22, 2023
1 parent 783aaa7 commit 44e9582
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/landing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Landing (Publish)

on:
workflow_dispatch:
push:
tags:
- landing.**

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install yarn
run: npm install -g yarn

- name: Build landing
run: ./sync-landing.sh
38 changes: 38 additions & 0 deletions publish-landing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

#
# This file is part of Blokada.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# Copyright © 2023 Blocka AB. All rights reserved.
#
# @author Karol Gusak ([email protected])
#

set -e

echo "Publishing landing: $1..."

cd landing
git co main
git pull
git co $1
git submodule update

cd ../

commit="publish landing: $1"
tag="landing.$1"

git add landing
git commit -m "$commit"
git tag $tag

git push
git push --tags


echo "Done"
42 changes: 42 additions & 0 deletions sync-landing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

#
# This file is part of Blokada.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# Copyright © 2023 Blocka AB. All rights reserved.
#
# @author Karol Gusak ([email protected])
#

set -e

cd landing-github-pages
git checkout master
git pull
cd ..

cd landing

hash=$(git describe --abbrev=4 --always --tags --dirty)
echo "Syncing landing to live: $hash..."

yarn build
cp -r dist/* ../landing-github-pages/
echo "$hash" > ../landing-github-pages/version.txt

cd ..

commit="publish landing: $hash"

cd landing-github-pages
git add .
git commit -am "$commit"
git tag "deploy-$hash"
git push
git push --tags

echo "Done"

0 comments on commit 44e9582

Please sign in to comment.