-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 2.14 KB
/
Copy path_release.yml
File metadata and controls
60 lines (54 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: "Release dev container features & Generate Documentation"
on:
# use this to test releasing of the devcontainer features in a branch
workflow_dispatch:
workflow_call:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: patch in version tag
# patch the version tag if the version is a valid semver. If not then
# default to 0.0.1-b1 (only when using workflow_dispatch for tests)
run: |
if [[ ${{ github.ref_name }} =~ ^[0-9]+\.[0-9]+.+ ]] ; then
sed -i s/0\.0\.1-b1/${{ github.ref_name }}/ $(find .devcontainer -name devcontainer-feature.json)
# dump the modified json for debugging
cat $(find .devcontainer -name devcontainer-feature.json)
fi
- name: "Publish Features"
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./src"
generate-docs: "true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the example features publishes docs like below - I believe this is only
# relevant if publishing to the marketplace?
# - name: Create PR for Documentation
# id: push_image_info
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# set -e
# echo "Start."
# # Configure git and Push updates
# git config --global user.email github-actions[bot]@users.noreply.github.com
# git config --global user.name github-actions[bot]
# git config pull.rebase false
# branch=automated-documentation-update-$GITHUB_RUN_ID
# git checkout -b $branch
# message='Automated documentation update'
# # Add / update and commit
# git add */**/README.md
# git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
# # Push
# if [ "$NO_UPDATES" != "true" ] ; then
# git push origin "$branch"
# gh pr create --title "$message" --body "$message"
# fi