|
|
|
name: docker
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Build image
|
|
|
|
run: >
|
|
|
|
docker buildx build
|
|
|
|
--file DiscordChatExporter.Cli.dockerfile
|
|
|
|
--platform linux/amd64,linux/arm64
|
|
|
|
--output type=tar,dest=DiscordChatExporter.Cli.Docker.tar
|
|
|
|
.
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: DiscordChatExporter.Cli.Docker
|
|
|
|
path: DiscordChatExporter.Cli.Docker.tar
|
|
|
|
|
|
|
|
deploy-latest:
|
|
|
|
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
run: >
|
|
|
|
echo ${{ secrets.DOCKER_TOKEN }} |
|
|
|
|
docker login --username tyrrrz --password-stdin
|
|
|
|
|
|
|
|
- name: Build & push image
|
|
|
|
run: >
|
|
|
|
docker buildx build
|
|
|
|
--file DiscordChatExporter.Cli.dockerfile
|
|
|
|
--platform linux/amd64,linux/arm64
|
|
|
|
--push
|
|
|
|
--tag tyrrrz/discordchatexporter:latest
|
|
|
|
.
|
|
|
|
|
|
|
|
deploy-stable:
|
|
|
|
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Get release version
|
|
|
|
id: get-version
|
|
|
|
uses: tyrrrz/action-get-tag@v1
|
|
|
|
|
|
|
|
- name: Install Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
run: >
|
|
|
|
echo ${{ secrets.DOCKER_TOKEN }} |
|
|
|
|
docker login --username tyrrrz --password-stdin
|
|
|
|
|
|
|
|
- name: Build & push image
|
|
|
|
run: >
|
|
|
|
docker buildx build
|
|
|
|
--file DiscordChatExporter.Cli.dockerfile
|
|
|
|
--platform linux/amd64,linux/arm64
|
|
|
|
--push
|
|
|
|
--tag tyrrrz/discordchatexporter:stable
|
|
|
|
--tag tyrrrz/discordchatexporter:${{ steps.get-version.outputs.tag }}
|
|
|
|
.
|