Files
scripts/.github/workflows/deploy.yml
Igor Pečovnik a046f2b3b1 Update deploy.yml
2022-01-06 13:27:11 +01:00

100 lines
2.5 KiB
YAML

name: Update hash
on:
workflow_dispatch:
workflow_call:
inputs:
uploading:
type: string
secrets:
GPG_KEY1:
required: true
GPG_PASSPHRASE1:
required: true
GPG_KEY2:
required: true
GPG_PASSPHRASE2:
required: true
SCRIPTS_ACCESS_TOKEN:
required: true
KEY_TORRENTS:
required: true
KNOWN_HOSTS_UPLOAD:
required: true
jobs:
Hash:
name: Update
runs-on: fast
if: ${{ github.repository_owner == 'Armbian' }}
steps:
- name: Remove previous artefacts if any
run: |
sudo rm -rf changes 2>/dev/null || true
- name: Download changes
uses: actions/download-artifact@v2
with:
name: changes
- name: Read value
run: |
[ -s changes ] || echo "SKIP=yes" >> $GITHUB_ENV
- name: Checkout Armbian build script
if: ${{ env.SKIP != 'yes' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: armbian/build
path: build
ref: nightly
clean: false
- name: Checkout Armbian support scripts
if: ${{ env.SKIP != 'yes' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: armbian/scripts
token: ${{ secrets.SCRIPTS_ACCESS_TOKEN }}
path: scripts
clean: true
- name: Import GPG key
if: ${{ env.SKIP != 'yes' }}
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_KEY2 }}
passphrase: ${{ secrets.GPG_PASSPHRASE2 }}
workdir: scripts
git-user-signingkey: true
git-commit-gpgsign: true
- name: Download artefacts
if: ${{ env.SKIP != 'yes' }}
uses: actions/download-artifact@v2
with:
name: hash
- name: Update scripts
if: ${{ env.SKIP != 'yes' }}
run: |
sudo rsync -ar --remove-source-files *.git* scripts/hash-beta/ || true
cd scripts
sudo chown -R $USER:$USER .git
if git status --porcelain | grep .; then
git config --global user.email "info@armbian.com"
git config --global user.name "Armbianworker"
git config pull.rebase false
git pull
git add .
git commit --allow-empty -m "Update hashes for ${{ env.FILE_DEST }} repository"
git push
fi