File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 1- name : Docker
1+ name : Docker
22
33on :
44 push :
5- tags :
6- - ' * '
5+ branches :
6+ - main
77env :
88 IMAGE_NAME : timezonebot
99 REGISTRY : ghcr.io
1010 DOCKERDEPLOY_HOST_USER : ${{secrets.DOCKERDEPLOY_HOST_USER }}
1111jobs :
1212 build_and_push :
13+ name : " 🚀 Build, Push, and Deploy"
1314 runs-on : ubuntu-latest
1415 if : github.event_name == 'push'
1516
7475 docker pull "${{ env.CURRENT_ID }}:latest"
7576 docker run -d --name=${{ env.IMAGE_NAME }} --env Discord__BotToken=${{ secrets.BOT_TOKEN }} --env Database__Cluster=${{ secrets.DB_CLUSTER }} --env Database__User=${{ secrets.DB_USER }} --env Database__Password=${{ secrets.DB_PASSWORD }} --env Database__Name=${{ secrets.DB_NAME }} --env FortniteApi__ApiKey=${{ secrets.FORTNITE_API_KEY }} --log-driver json-file --log-opt max-size=10m --log-opt max-file=3 --restart=unless-stopped ${{ env.CURRENT_ID }}:latest
7677 exit
78+ create_tag_and_release :
79+ name : " 🏷️ Create Tag and Release"
80+ runs-on : ubuntu-latest
81+ if : github.event_name == 'push'
82+ needs : build_and_push
83+ steps :
84+ - uses : actions/checkout@v4
85+ - name : Read VersionNumber from appsettings.json
86+ id : get_version
87+ run : |
88+ APP_VERSION=$(jq -r '.Version.VersionNumber' TimeZoneBot/appsettings.json)
89+ echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
90+ - name : Create Tag
91+ id : create_tag
92+ run : |
93+ git config --global user.email "${{ github.actor }}@users.noreply.github.com"
94+ git config --global user.name "${{ github.actor }}"
95+ git tag -a "v${{ env.APP_VERSION }}" -m "Release version ${{ env.APP_VERSION }}"
96+ git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} "v${{ env.APP_VERSION }}"
97+ - name : Create Release
98+ run : |
99+ gh release create "${{ env.APP_VERSION }}" --generate-notes --title "${{ env.APP_VERSION }}"
100+ env :
101+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 11{
22 "Version" : {
3- "VersionNumber" : " 7.8.3 "
3+ "VersionNumber" : " 7.8.4 "
44 },
55 "Discord" : {
66 "BotToken" : " token" ,
You can’t perform that action at this time.
0 commit comments