diff --git a/.github/workflows/mai.yml b/.github/workflows/mai.yml new file mode 100644 index 0000000..d60b639 --- /dev/null +++ b/.github/workflows/mai.yml @@ -0,0 +1,23 @@ +name: Releases + +on: + push: + branches: ["main"] + + +jobs: + + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - uses: alphaleadership/release-action@1.0.0 + with: + tag: "la" + generateReleaseNotes: true + skipIfReleaseExists: false + makeLatest: true + artifacts: "release.tar.gz,foo/*.txt" + bodyFile: "README.md" diff --git a/action.yml b/action.yml index b07c2ad..4410516 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: 'Vue to Github Pages' +name: 'Vue to Github Pages reloaded' branding: icon: 'activity' color: 'blue' @@ -38,15 +38,78 @@ runs: steps: - name: Build Vue run: | - if [ true == ${{ inputs.useyarn }} ]; then yarn install --frozen-lockfile; else npm ci; fi + git config --global user.email "${{ inputs.gitemail }}" + git config --global user.name "${{ inputs.gitname }}" + + cd dist + + git init + + git remote add origin https://${{ inputs.username }}:${{ inputs.token }}@github.com/${{ inputs.username }}/${{ inputs.reponame }}.git -m pages + git fetch + echo fetch + git branch -m pages + echo branch + echo temp >log.txt + git add * + + git commit -m temp + + git branch --set-upstream-to=origin + echo branch 2 + git remote -v + echo test + git fetch + echo fetch + git pull -u + echo pull + + cd .. + cd cdn + + git init + + git remote add origin https://${{ inputs.username }}:${{ inputs.token }}@github.com/${{ inputs.username }}/cdn.git -m main + git fetch + echo fetch + git branch -m main + echo branch + echo temp >log.txt + git add * + git commit -m temp + + git branch --set-upstream-to=origin + echo branch 2 + git remote -v + echo test + git fetch + echo fetch + git pull -u + echo pull + + cd .. + if [ true == ${{ inputs.useyarn }} ]; then yarn install --frozen-lockfile; else npm i; fi if [ true == ${{ inputs.useyarn }} ]; then yarn build; else npm run build; fi + + git pull -u + git push -u cd dist ln -s index.html 404.html if [ "none" != ${{ inputs.cname }} ]; then echo '${{ inputs.cname }}' > CNAME; fi - git config --global user.email "${{ inputs.gitemail }}" - git config --global user.name "${{ inputs.gitname }}" - git init + + git add -A + git commit -m '${{ inputs.gitmsg }}' + if ! git diff --quiet remotes/origin/HEAD; then git push ; fi + cd .. + cd cdn + + if [ "none" != ${{ inputs.cname }} ]; then echo '${{ inputs.cname }}' > CNAME; fi + git add -A git commit -m '${{ inputs.gitmsg }}' - git push -f https://${{ inputs.username }}:${{ inputs.token }}@github.com/${{ inputs.username }}/${{ inputs.reponame }}.git master:gh-pages + if ! git diff --quiet remotes/origin/HEAD; then git push ; fi + cd .. + git add -A + git commit -m "update" + git push -u shell: bash