Forgot to update the baseimage name #521
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Refactor on AWS | |
on: push | |
jobs: | |
build-recore-octoprint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build Refactor Recore with OctoPrint on AWS | |
uses: garygrossgarten/github-action-ssh@release | |
with: | |
command: | | |
cd Refactor | |
git fetch | |
export branch=$(echo ${{github.ref}} | cut -d'/' -f 3-) | |
git reset --hard | |
git checkout --force $branch | |
git pull | |
git log HEAD --oneline --no-walk | |
rm -rf Refactor-*.xz | |
ls armbian*.img.xz | grep -v $(date +"%F") | xargs -d"\n" rm -rf | |
sudo ./build-image-in-chroot-end-to-end.sh recore | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
privateKey: ${{ secrets.PRIVATE_KEY}} | |
env: | |
CI: true | |
- name: Download file via SSH if tagged | |
uses: nicklasfrahm/scp-action@main | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
direction: download | |
host: ${{ secrets.HOST }} | |
fingerprint: ${{ secrets.EC2_FINGERPRINT }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
source: /home/admin/Refactor/Refactor-recore-latest.img.xz | |
target: ./Refactor-recore-octoprint-latest.img.xz | |
- name: Rename file | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
TAG=$(git log -n1 --pretty="format:%d" | sed "s/, /\n/g" | grep tag: | grep -v origin | sed "s/tag: \|)//g" | tr -d '\n') | |
if [[ $TAG == "" ]]; then | |
TAG=$(git reflog --decorate -1 | awk -F' ' '{print $1}' | tr -d '\n') | |
fi | |
DATE=$(date --iso-8601) | |
mv ./Refactor-recore-octoprint-latest.img.xz Refactor-recore-octoprint-${TAG}-${DATE}.img.xz | |
- name: Release if tagged | |
uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
allowUpdates: true | |
artifacts: Refactor-recore-octoprint-*.img.xz | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
build-recore-mainsail: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build Refactor Recore with Mainsail on AWS | |
uses: garygrossgarten/github-action-ssh@release | |
with: | |
command: | | |
cd Refactor | |
git fetch | |
export branch=$(echo ${{github.ref}} | cut -d'/' -f 3-) | |
git reset --hard | |
git checkout --force $branch | |
git pull | |
git log HEAD --oneline --no-walk | |
rm -rf Refactor-*.xz | |
sudo ./build-image-in-chroot-end-to-end.sh recore SYSTEM_klipper_mainsail-DEFAULT.yml | |
host: ${{ secrets.HOST_REPLICAPE }} | |
username: ${{ secrets.USERNAME }} | |
privateKey: ${{ secrets.PRIVATE_KEY}} | |
env: | |
CI: true | |
- name: Download file via SSH if tagged | |
uses: nicklasfrahm/scp-action@main | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
direction: download | |
host: ${{ secrets.HOST_REPLICAPE }} | |
fingerprint: ${{ secrets.EC2_FINGERPRINT_REPLICAPE }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
source: /home/admin/Refactor/Refactor-recore-latest.img.xz | |
target: ./Refactor-recore-mainsail-latest.img.xz | |
- name: Rename file if tagged | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
TAG=$(git log -n1 --pretty="format:%d" | sed "s/, /\n/g" | grep tag: | grep -v origin | sed "s/tag: \|)//g" | tr -d '\n') | |
if [[ $TAG == "" ]]; then | |
TAG=$(git reflog --decorate -1 | awk -F' ' '{print $1}' | tr -d '\n') | |
fi | |
DATE=$(date --iso-8601) | |
mv ./Refactor-recore-mainsail-latest.img.xz Refactor-recore-mainsail-${TAG}-${DATE}.img.xz | |
- name: Release if tagged | |
uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
allowUpdates: true | |
artifacts: Refactor-recore-mainsail-*.img.xz | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true |