sandstorm-server/.github/workflows/docker-image.yml
dependabot[bot] 2038764ddb
Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-17 10:09:37 +00:00

68 lines
No EOL
2.3 KiB
YAML

name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 * * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check new version
continue-on-error: true
id: status
run: |
LOCALAPPVER=($(cat sandstorm.version))
REMOTEAPPVER=($(curl -s -X GET 'https://api.steamcmd.net/v1/info/581330' | jq -r -e '.data."581330".depots."581333".manifests.public'))
if [ -z "$REMOTEAPPVER" -a "$REMOTEAPPVER" = " " ]; then
echo "Empty Response"
exit 1
fi
if [[ "$LOCALAPPVER" != "$REMOTEAPPVER" ]]; then
echo "$REMOTEAPPVER" >sandstorm.version
exit 0
else
echo "Version not changed"
exit 1
fi
shell: bash
-
name: Login to DockerHub
if: steps.status.outcome == 'success'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: build
if: steps.status.outcome == 'success'
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: andrewmhub/insurgency-sandstorm:latest
- name: login to git
if: steps.status.outcome == 'success'
run: |
git config --global user.name 'Andrew Marchukov'
git config --global user.email "${EMAIL}"
git remote set-url origin https://x-access-token:${{ secrets.GIT_TOKEN }}@github.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize.git
- name: check for changes
if: steps.status.outcome == 'success'
run: git status
- name: stage changed files
if: steps.status.outcome == 'success'
run: git add sandstorm.version
- name: commit changed files
if: steps.status.outcome == 'success'
run: git commit -m "Auto updating sandstorm.version"
- name: fetch from master
if: steps.status.outcome == 'success'
run: git fetch origin master
- name: push code to master
if: steps.status.outcome == 'success'
run: git push origin HEAD:master