Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/deploy-production-manual.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/deploy-production-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy production (push)
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
web:
- 'src/**'
- '.babelrc'
- 'astro.config.mjs'
- 'netlify.toml'
- 'package-lock.json'
- 'package.json'
# run only if 'web' files were changed
- name: Add deployable commit to 'production' branch
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
if: steps.filter.outputs.web == 'true'
run: |
chmod +x ./src/scripts/deploy.sh
./src/scripts/deploy.sh production ${github.event_name}
22 changes: 4 additions & 18 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,15 @@ name: Deploy production
on:
schedule:
- cron: "20 18 * * *"
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
web:
- 'src/**'
- '.babelrc'
- 'astro.config.mjs'
- 'netlify.toml'
- 'package-lock.json'
- 'package.json'
# run only if 'web' files were changed
- name: Run deployment script
- uses: actions/checkout@v1
- name: Add deployable commit to 'production' branch
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
if: steps.filter.outputs.web == 'true'
run: |
chmod +x ./src/scripts/deploy.sh
./src/scripts/deploy.sh production
./src/scripts/deploy.sh production ${github.event_name}
2 changes: 1 addition & 1 deletion src/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ deploy_branch() {
git config --global user.name "30secondsofcode"
git checkout -b $1
git reset --hard origin/master
git commit -m "Deployment - $(date +%Y.%m.%d_%H:%M)" --allow-empty
git commit -m "[$(date +%Y.%m.%d_%H:%M)] Deployment/$2" --allow-empty
git push --force --quiet "https://${GH_TOKEN}@github.com/30-seconds/30-seconds-of-code.git" $1 > /dev/null 2>&1
}

Expand Down