Auto Update Bot #2791
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
name: Auto Update Bot | |
on: | |
# push: | |
# branches: | |
# - master | |
schedule: | |
- cron: '20 */8 * * *' | |
workflow_dispatch: | |
jobs: | |
auto-update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check Update | |
run: | | |
git config --global user.name "Lomot Bot" | |
git config --global user.email "[email protected]" | |
bash ./script/auto-update.sh | |
- name: Publish Image | |
if: ${{ env.HAS_UPDATE || env.PUBLISH_IMAGE }} | |
run: | | |
echo "building ${{ env.RELEASE_VERSION }}" | |
docker build . --file Dockerfile --tag lomot/minecraft-bedrock:latest | |
docker login --username=${{ secrets.DOCKER_ID }} --password=${{ secrets.DOCKER_TOKEN }} | |
docker tag lomot/minecraft-bedrock:latest lomot/minecraft-bedrock:${{ env.RELEASE_VERSION }} | |
docker push lomot/minecraft-bedrock:${{ env.RELEASE_VERSION }} | |
docker push lomot/minecraft-bedrock:latest | |
exit | |
- name: Push Commit | |
if: ${{ env.HAS_UPDATE && env.RELEASE_VERSION != 'debug' }} | |
run: | | |
git config --global user.name "Update Bot" | |
# git config --global user.email "[email protected]" | |
git add . && git commit -am "update to ${{ env.RELEASE_VERSION }} by lomot-bot" | |
git push | |
git tag ${{ env.RELEASE_VERSION }} | |
git push --tag | |
- name: Create Release | |
if: ${{ env.HAS_UPDATE && env.RELEASE_VERSION != 'debug' }} | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
release_name: Release ${{ env.RELEASE_VERSION }} | |
draft: false | |
prerelease: false |