forked from fcwu/docker-ubuntu-vnc-desktop
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Re-enable /resize URI * Update for Ubuntu 22.04 (WIP) LXDE shows "Failed to close file descriptor for child process" error * fix: Fix noVNC launch error * ci: Add GitHub Actions config * fix: Fix arm64 execution error qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory * ci: Fix config * chore: Clean-up Makefile * ci: Fix submodule clone error
- Loading branch information
Showing
9 changed files
with
240 additions
and
337 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
env: | ||
DOCKER_USERNAME: tiryoh | ||
DOCKER_IMAGENAME: ubuntu-desktop-lxde-vnc | ||
GIT_CONFIG_USER: Tiryoh@GitHubActions | ||
GIT_CONFIG_EMAIL: [email protected] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
distro: | ||
- jammy | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Setup Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to docker.io | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Prepare Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_IMAGENAME }} | ||
tags: | | ||
type=raw,value=${{ matrix.distro }} | ||
type=raw,value=${{ matrix.distro }}-{{date 'YYYYMMDDTHHmm'}} | ||
flavor: | | ||
latest=${{ matrix.distro == 'jammy' }} | ||
prefix= | ||
suffix= | ||
- name: Build and Publish | ||
id: docker-build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64, linux/arm64 | ||
outputs: type=registry # same as --push, push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
|
||
- # Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md | ||
name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
- name: Get Current Job Log URL | ||
id: jobs | ||
uses: Tiryoh/gha-jobid-action@v0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
job_name: build-and-deploy (${{ matrix.distro }}) | ||
|
||
- name: Update wiki | ||
env: | ||
DOCKER_TAGNAME: ${{ matrix.distro }} | ||
run: | | ||
DOCKER_SNAPSHOT=$(cat << EOF | grep ".*-.*T.*" | sed -E "s/.*:(.*-[0-9]*T[0-9])/\1/g" | ||
${{ steps.meta.outputs.tags }} | ||
EOF) | ||
echo $DOCKER_SNAPSHOT | ||
DOCKER_DIGEST=${{ steps.docker-build.outputs.digest }} | ||
echo $DOCKER_DIGEST | ||
DOCKER_DIGEST_SHORT=$(echo ${DOCKER_DIGEST} | sed -E 's/.*([0-9a-z]{12})[0-9a-z]{52}$/\1/g') | ||
echo $DOCKER_DIGEST_SHORT | ||
DOCKER_SNAPSHOT_IMAGE_HISTORY_URL=$(echo "https://hub.docker.com/r/${DOCKER_USERNAME}/${DOCKER_IMAGENAME}/tags?page=1&name=${DOCKER_SNAPSHOT}") | ||
git clone --depth=1 https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.wiki.git wiki | ||
cd wiki | ||
LINE=$(grep -n "add ${{ matrix.distro }} msg after this line" ${{ matrix.distro }}.md | cut -d ":" -f 1) | ||
head -n $LINE ${{ matrix.distro }}.md > tmp.md | ||
echo "* \`${DOCKER_DIGEST_SHORT}\`" | tee -a tmp.md | ||
echo " * uploaded on $(date --iso-8601="minutes")" | tee -a tmp.md | ||
echo " * ${{ steps.jobs.outputs.html_url }}" | tee -a tmp.md | ||
echo " * snapshot" | tee -a tmp.md | ||
echo " * [\`${DOCKER_SNAPSHOT}\`](${DOCKER_SNAPSHOT_IMAGE_HISTORY_URL})" | tee -a tmp.md | ||
tail -n +$(( $LINE+1 )) ${{ matrix.distro }}.md >> tmp.md | ||
mv tmp.md ${{ matrix.distro }}.md | ||
git config --local user.email "${GIT_CONFIG_EMAIL}" | ||
git config --local user.name "${GIT_CONFIG_USER}" | ||
git add ${{ matrix.distro }}.md | ||
git commit -m "Update ${{ matrix.distro }}.md" | ||
git fetch origin && git merge origin/master --no-edit && git push origin master || \ | ||
git fetch origin && git merge origin/master --no-edit && git push origin master |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.