Moved workflows folder into .github instead.
This commit is contained in:
parent
86a41f7d52
commit
54494351f4
1 changed files with 8 additions and 3 deletions
|
|
@ -10,11 +10,16 @@ on:
|
|||
- 'master'
|
||||
- 'main'
|
||||
|
||||
env:
|
||||
IS_PUSH: ${{ github.event_name == 'push' }}
|
||||
IS_MAIN: ${{ github.event.repository.default_branch == github.ref_name }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# image: ubuntu:latest
|
||||
options: --volume "${{ secrets.NGINX_HTML_DIRECTORY }}:/usr/share/nginx/html:rw"
|
||||
steps:
|
||||
-
|
||||
|
|
@ -35,13 +40,13 @@ jobs:
|
|||
git lfs checkout
|
||||
-
|
||||
name: Get Metadata
|
||||
id: metadata
|
||||
id: meta
|
||||
run: |
|
||||
branchName=${GITHUB_REF#refs/heads/}
|
||||
version=$(date +"%y%m.%d.%H%M%S")
|
||||
tagName=$version
|
||||
preRelease=false
|
||||
if [[ "$branchName" != "master" && "$branchName" != "main" ]]; then
|
||||
if [[ ${{ env.IS_MAIN }} == "false" ]]; then
|
||||
tagName="$tagName-$branchName"
|
||||
preRelease=true
|
||||
fi
|
||||
|
|
@ -65,7 +70,7 @@ jobs:
|
|||
-
|
||||
name: Append version query arg to asset URLs
|
||||
env:
|
||||
VERSION: ${{ steps.metadata.outputs.VERSION }}
|
||||
VERSION: ${{ steps.meta.outputs.VERSION }}
|
||||
run: |
|
||||
echo "VERSION = $VERSION"
|
||||
find public -type f -name '*.html' -exec sed -i "s/\"\([^\"?]\+\.css\)\"/\"\1?v=$VERSION\"/g" {} +
|
||||
Loading…
Add table
Add a link
Reference in a new issue