-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (60 loc) · 1.98 KB
/
Copy pathaction1.yaml
File metadata and controls
60 lines (60 loc) · 1.98 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: action-to-publish-app
on:
push:
branches:
- main
jobs:
deploy-the-website-online:
runs-on: ubuntu-latest
steps:
- run: |
echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
echo "I am in ${{ github.workspace }}."
echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
echo "Actual things now."
echo "Cloning repo:"
git clone https://Benur21:${{ secrets.GITHUB_TOKEN }}@github.com/Benur21/HTML-CSS.git
echo "-Entering the repo folder:"
cd HTML-CSS/
echo "-Current path:"
pwd
echo "-Current files:"
ls -l -a
echo "-Build the app:"
yarn && yarn run build
echo "-Current branch:"
git branch
echo "-Checkout branch:"
git checkout gh-pages
echo "-Current branch:"
git branch
echo "-Current files:"
ls -l -a
echo "-Removing old files:"
shopt -s extglob
rm -f -r !(dist)
ls -l -a
echo "-Moving new files:"
mv dist/* .
ls -l -a
echo "-Removing empty:"
rm -r dist
ls -l -a
echo "-Configurating git:"
git config user.name Benur21
git config user.email Benur21@users.noreply.github.com
echo "-Git status:"
git status
echo "-Git add .:"
git add .
echo "-Commit:"
git commit -m "deploy: ${{ github.sha }}" --allow-empty
echo "-Git status:"
git status
echo "-Git log:"
git log -3
echo "-Push:"
git push
echo "🍏 This job's status is ${{ job.status }}."