You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
name: docker
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Build container
|
|
run: docker build -f DiscordChatExporter.Cli.dockerfile .
|
|
|
|
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: Login to DockerHub
|
|
run: docker login -u tyrrrz -p ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Build container
|
|
run: docker build -f DiscordChatExporter.Cli.dockerfile -t tyrrrz/discordchatexporter:latest .
|
|
|
|
- name: Push container
|
|
run: docker push 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: dawidd6/action-get-tag@v1
|
|
|
|
- name: Login to DockerHub
|
|
run: docker login -u tyrrrz -p ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Build container
|
|
run: docker build -f DiscordChatExporter.Cli.dockerfile -t tyrrrz/discordchatexporter:stable -t tyrrrz/discordchatexporter:${{ steps.get_version.outputs.tag }} .
|
|
|
|
- name: Push container (stable)
|
|
run: docker push tyrrrz/discordchatexporter:stable
|
|
|
|
- name: Push container (${{ steps.get_version.outputs.tag }})
|
|
run: docker push tyrrrz/discordchatexporter:${{ steps.get_version.outputs.tag }} |