This is my blasting field for Github Actions. The place to test workflows, actions their result.
- Official help for GitHub Actions
- You cannot use the
alpine
image asruns-on
- The only available options can be found on the page: Virtual Environments for GitHub-hosted Runners
- You can use a Docker image
- Job names must start with a letter or
_
and contain only alphanumeric characters,-
, or_
- You can react to tags without declaring the branch
- If you have a syntax error in your workflow file, you lose access to the history of previous builds for that workflow
- The workflow must contain at least one job with no dependencies
- If the cron schedule contains a slash
/
character, it needs to be in quotes - Scheduled tasks seem to have some delay in starting
- The difference between
github.ref_name
andGITHUB_REF
while dealing with tag: one return only the tag name, the other the full tag name (with prefix)
There is possibility for publish npm packages directly on Github (as not scoped repository). See GitHub Packages: Your packages, at home with their code.
The usage in workflow is described here: Publishing Node.js packages.
Example set-up code:
- name: "Set up the NPM"
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: 'https://npm.pkg.github.com'
scope: '@dplocki'
Later usage:
- name: "Compering version"
run: |
echo `npm info @dplocki/generic-conversation-bot version`
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Tag
uses: negz/create-tag@v1
with:
version: v0.1.1
message: Release for version v0.1.1
token: ${{ secrets.GITHUB_TOKEN }}
run: |
cat << EOF > run.py
echo line 1
echo line 2
; no indents on each of this lines
EOF