diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..ea75fc2 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,20 @@ +name: 'master' + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Docker Login + run: docker login docker.pkg.github.com -u namshi -p $GITHUB_TOKEN + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Docker Build + run: docker build --tag docker.pkg.github.com/namshi/docker-smtp/smtp:latest . + - name: Docker Publish + run: docker push docker.pkg.github.com/namshi/docker-smtp/smtp:latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0303e5e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: 'release' + +on: + push: + tags: + - 'v*.*.*' + - '!v*.*.*-*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} + + - name: Docker Login + run: docker login docker.pkg.github.com -u namshi -p $GITHUB_TOKEN + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Docker Build + run: docker build --tag docker.pkg.github.com/namshi/docker-smtp/smtp:${{ steps.get_version.outputs.VERSION }} . + - name: Docker Publish + run: docker push docker.pkg.github.com/namshi/docker-smtp/smtp:${{ steps.get_version.outputs.VERSION }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false