reformat #75
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 is a basic workflow to help you get started with Actions | |
name: generate doc | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the dev branch | |
push: | |
branches: [ dev ] | |
# pull_request: | |
# branches: [ dev ] | |
# Allows you to run this workflow manually from the Actions tab | |
# workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build_docker: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
env: | |
# need to set env DISPLAY to avoid | |
# "Make sure that your X server is running and that $DISPLAY is set correctly." error | |
# during dockerfile build image | |
# see: https://github.com/juliangruber/browser-run/issues/147#issuecomment-754553635 | |
DISPLAY: :99 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
# - uses: actions/checkout@v2 | |
# - name: Setup Python | |
# uses: actions/[email protected] | |
# # with: | |
# # # Version range or exact version of a Python version to use, using SemVer's version range syntax. | |
# # python-version: # optional, default is 3.x | |
# # # The target architecture (x86, x64) of the Python interpreter. | |
# # architecture: # optional | |
# # # Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user. | |
# # token: # optional, default is ${{ github.token }} | |
# Sharing Docker containers between jobs in a workflow · Issue #225 · docker/build-push-action | |
# https://github.com/docker/build-push-action/issues/225 | |
# should preserve this step to be able the use of "outputs: type=docker" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
# switch outputs type from "oci" to "docker" | |
# to avoid incorrect name and tag. | |
# "outputs: type=docker,dest=/tmp/image.tar" | |
# see: https://github.com/docker/build-push-action/issues/225#issuecomment-727639184 | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
file: .devcontainer/Dockerfile | |
# push: true | |
# tags: user/app:latest | |
tags: user/myimage:latest | |
outputs: type=docker,dest=/tmp/myimage.tar | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: myimage | |
path: /tmp/myimage.tar | |
gen_doc: | |
needs: build_docker | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
# see: https://docs.github.com/en/actions/reference/environment-variables | |
# Fetch all history for all tags and branches | |
# https://github.com/actions/checkout | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: myimage | |
path: /tmp | |
# - name: Load image and Run portray | |
# run: | | |
# docker load --input /tmp/myimage.tar | |
# docker run | |
- name: Load docker image | |
run: | | |
docker load < /tmp/myimage.tar | |
# docker run --rm --user="vscode" user/myimage:latest "/bin/bash --login -c 'pwd;echo \$PATH;env;pip list;conda env list'" | |
- name: Run CMD in docker | |
# run: docker image ls | |
# run: docker run --rm --user="vscode" user/myimage:latest /bin/bash --login -c 'pwd;echo \$PATH;env;pip list;conda env list' | |
# run: docker run --rm --user="vscode" user/myimage:latest /bin/bash --login -c 'pwd;env;pip list;conda env list;portray on_github_pages' | |
# run: echo $GITHUB_WORKSPACE;cd $GITHUB_WORKSPACE;pwd;ls | |
# run: pwd;ls;cd /;ls;cd /home/runner/work/DataTag_helper;ls;cd /home/runner/work/DataTag_helper/DataTag_helper;ls | |
# run: docker run --rm --user="vscode" user/myimage:latest conda run --no-capture-output -n DataTag_helper /bin/bash -c "id -u -n;pwd;env;pip list;conda env list;ls;cd /;ls;cd -" | |
# conda run | |
# --cwd CWD Current working directory for command to run in. | |
# Defaults to cwd | |
# see: https://github.com/conda/conda/issues/2904#issuecomment-522722761 | |
# run: docker run --rm --user="vscode" -v $GITHUB_WORKSPACE:/workspaces/DataTag_helper user/myimage:latest conda run --no-capture-output --cwd /workspaces/DataTag_helper -n DataTag_helper ls | |
# UID used in github actions to avoid Permission denied: | |
# https://github.com/francisfuzz/actions-uid-gid | |
run: docker run --rm --user 1001 -v $GITHUB_WORKSPACE:/workspaces/DataTag_helper user/myimage:latest conda run --no-capture-output --cwd /workspaces/DataTag_helper -n DataTag_helper portray on_github_pages | |
# Runs a single command using the runners shell | |
# - name: Run portray | |
# run: portray on_github_pages | |
# Runs a set of commands using the runners shell | |
# - name: Run a multi-line script | |
# run: | | |
# echo Add other actions to build, | |
# echo test, and deploy your project. |