1+ name : Publish Docker
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # Push events to every tag not containing /
7+
8+ # Pattern matched against refs/tags
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v2
15+ - name : Set env
16+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
17+ - name : Test
18+ run : |
19+ echo $RELEASE_VERSION
20+ echo ${{ env.RELEASE_VERSION }}
21+ - name : Setup .NET
22+ uses : actions/setup-dotnet@v1
23+ with :
24+ dotnet-version : 6.0.x
25+ - name : Restore dependencies
26+ run : dotnet restore CheapSteam.UI/CheapSteam.UI/CheapSteam.UI.csproj
27+ - name : Publish Linux x64
28+ run : dotnet publish CheapSteam.UI/CheapSteam.UI/CheapSteam.UI.csproj --runtime linux-x64 -p:PublishSingleFile=true --self-contained true -o ./CheapSteam-${{ env.RELEASE_VERSION }}-linux-x64 -c Release
29+ - name : Edit default listen url
30+ run : sed -i 's/127.0.0.1/0.0.0.0/g' ./CheapSteam-${{ env.RELEASE_VERSION }}-linux-x64/appsettings.json
31+ - name : Zip files
32+ run : zip -r CheapSteam-${{ env.RELEASE_VERSION }}-linux-x64.zip ./CheapSteam-${{ env.RELEASE_VERSION }}-linux-x64
33+ - name : Copy bin files
34+ run : cp CheapSteam-${{ env.RELEASE_VERSION }}-linux-x64.zip docker/
35+ -
36+ name : Set up QEMU
37+ uses : docker/setup-qemu-action@v2
38+ -
39+ name : Set up Docker Buildx
40+ uses : docker/setup-buildx-action@v2
41+ -
42+ name : Login to DockerHub
43+ uses : docker/login-action@v2
44+ with :
45+ username : ${{ secrets.DOCKERHUB_USERNAME }}
46+ password : ${{ secrets.DOCKERHUB_TOKEN }}
47+ -
48+ name : Edit default dockerfile
49+ run : sed -i 's/RELEASE_VERSION/${{ env.RELEASE_VERSION }}/g' docker/dockerfile
50+ -
51+ name : Build and push
52+ uses : docker/build-push-action@v3
53+ with :
54+ push : true
55+ tags : sayokurisu/cheapsteam:latest,sayokurisu/cheapsteam:${{ env.RELEASE_VERSION }}
56+ context : docker
0 commit comments