name: automation
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkar in på den aktuella branschen och repon
uses: actions/checkout@v2
# Använder tillfälligt dotnet-miljön
- name: Setup Dotnet Env
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Kör restore
run: dotnet restore
- name: Kör vår Build
run: dotnet build --no-restore
- name: Genomför unit-tester
run: dotnet test --no-build
- name: Loggar in på Docker
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Building the Docker Image och skickar den till Docker Hub
uses: docker/build-push-action@v2.9.0
with:
push: true
tags: ANVÄNDARNAMN_PÅ_DOCKER_HUB/NAMNET_OCH_TAGEN_TILL_DIN_IMAGE
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Tack tack, bra jobbat!
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.