update go version #256
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: build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
steps: | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Print go version | |
run: go version | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v1 | |
# - name: Git LFS setup | |
# run: git lfs pull | |
- name: Build | |
run: make build | |
- name: Test | |
run: make test | |
- name: Coverage | |
run: bash <(curl -s https://codecov.io/bash) | |
- name: Generate build number | |
uses: einaregilsson/build-number@v2 | |
with: | |
token: ${{secrets.github_token}} | |
- name: Setup tag | |
run: echo "::set-env name=TAG::0.6.$BUILD_NUMBER" | |
- name: Build docker container | |
run: | | |
docker build -t ${{ github.repository }}:$TAG -t ${{ github.repository }}:latest . | |
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin | |
docker push --all-tags ${{ github.repository }} | |
env: | |
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} | |
DOCKER_PWD: ${{ secrets.DOCKER_PWD }} | |
- name: Deploy app | |
run: | | |
echo "$SSH_IDENTITY_KEY" > identity | |
chmod 600 identity | |
ssh -i identity -o StrictHostKeyChecking=no root@proxy.ailinykh.com "/bin/bash ./docker/pullanusbot/deploy_app.sh $TAG" | |
env: | |
SSH_IDENTITY_KEY: ${{ secrets.SSH_IDENTITY_KEY }} | |